Commit graph

11 commits

Author SHA1 Message Date
Thomas Haller
c3dd6a7355 xfrm: trival refactoring initialization of stack-allocated arguments to nl_send_simple()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2015-05-12 14:56:57 +02:00
Tobias Klauser
4e115113c9 xfrm: fix potential NULL dereference
If xfrmnl_sel_alloc() returns NULL, the daddr and saddr members are
still accessed, leading to a potential NULL dereference. The same is the
case for xfrmnl_user_tmpl_alloc(). Fix this by returning NULL right away
if allocation fails.

http://lists.infradead.org/pipermail/libnl/2015-May/001874.html

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
2015-05-12 13:14:26 +02:00
Nicolas PLANEL
06140c3ec9 xfrm: fix xfrm_sa_msg_parser() to return the value from the callback
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-27 13:00:46 +02:00
Nicolas PLANEL
77bbf2270c xfrm: fix an unintialized return value on memory allocation error in xfrmnl_ae_parse()
fix : err = -ENOMEM if calloc() failed

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-27 12:59:39 +02:00
Nicolas PLANEL
54ae1d95a4 xfrm: fix calling free() with a bad pointer
sp->sec_ctx->ctx is a zero-length member, so it's already allocated

https://github.com/thom311/libnl/pull/61

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-26 16:52:17 +02:00
Thomas Graf
c231aa4159 xfrm: Remove unused variable sp_id and sa_id
Cc: Sruthi Yellamraju <ysruthi@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-26 13:09:20 +02:00
Thomas Graf
a45fca9a58 xfrm: Remove unused function __assign_addr()
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-26 13:09:20 +02:00
Thomas Haller
fc249f81c7 style: require comma after __ADD() macro
$ sed -i 's/^\([\t ]\+\<__ADD\> \?([^)]\+)\) *$/\1,/' `git grep -w -l __ADD`

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-27 10:57:31 +02:00
Cong Wang
956b758f7e xfrm: use the right specifier for uint64_t
This fixes compile warnings like this:

xfrm/sp.c: In function 'xfrm_sp_dump_line':
xfrm/sp.c:346:3: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'uint64_t' [-Wformat=]
   sprintf (dir, "%llu", sp->lft->soft_byte_limit);

Cc: Thomas Haller <thaller@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-21 19:59:39 +02:00
Thomas Haller
51941b1356 xfrm: style-fixes
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-20 18:15:16 +02:00
Sruthi Yellamraju
9171544708 xfrm: add xfrm support
Signed-off-by: Sruthi Yellamraju <ysruthi@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-20 18:14:46 +02:00