]> granicus.if.org Git - libnl/log
libnl
9 years agoutils: add missing link layer protocol translations
Thomas Haller [Thu, 4 Jun 2015 21:03:36 +0000 (23:03 +0200)]
utils: add missing link layer protocol translations

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoutils: update link layer protocol translations
Tobias Klauser [Tue, 19 May 2015 11:40:24 +0000 (13:40 +0200)]
utils: update link layer protocol translations

Update the private copy of linux/if_arp.h and hook up the not yet
defined ARPHRD_* types in the llprotos translation table. Reorder the
entries such that they correspond to the order they're defined in
linux/if_arp.h. Also remove the #ifdef guards since these are
unnecessary given that the private copy of the kernel header is used.

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

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoroute/link: fix memleaks in link_msg_parser()
Thomas Haller [Wed, 13 May 2015 12:46:08 +0000 (14:46 +0200)]
route/link: fix memleaks in link_msg_parser()

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agolib/doc: clearify return value of send_simple() functions
Thomas Haller [Tue, 12 May 2015 13:04:48 +0000 (15:04 +0200)]
lib/doc: clearify return value of send_simple() functions

The return value of the *nl_send_simple() functions is
inconsistent and not according to the documentation.

nl_send_simple() is document to return the number of bytes sent.
Other *nl_send_simple() functions are documented to return 0 on
success -- for the most part.
See also commit b70174668b9867de573cf51471bc98bfe7fd2bc3 which
changed behavior of nl_rtgen_request() to be according to documenation.

Don't change behavior again, only adjust the documentation.

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

Reported-by: Xiao Jia <stfairy@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoxfrm: trival refactoring initialization of stack-allocated arguments to nl_send_simple()
Thomas Haller [Tue, 12 May 2015 12:45:08 +0000 (14:45 +0200)]
xfrm: trival refactoring initialization of stack-allocated arguments to nl_send_simple()

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agopython: merge branch 'python-capi'
Thomas Haller [Tue, 12 May 2015 11:26:26 +0000 (13:26 +0200)]
python: merge branch 'python-capi'

Disable debug macro in swig API to reduce the noise
and expose a couple of functions.

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

9 years agopython: genl: capi: add genlmsg_hdr() to capi
Arend van Spriel [Sun, 10 May 2015 10:29:12 +0000 (12:29 +0200)]
python: genl: capi: add genlmsg_hdr() to capi

Allow using genlmsg_hdr() function and make the header fields
accessible in Python scripts.

Signed-off-by: Arend van Spriel <aspriel@gmail.com>
9 years agopython: capi: add nla_put() function to python capi
Arend van Spriel [Sun, 10 May 2015 10:22:17 +0000 (12:22 +0200)]
python: capi: add nla_put() function to python capi

Adding nla_put() to the capi using a typemap on the input
parameter which needs to be either a str or bytearray.
Otherwise a SWIG exception with be thrown.

Signed-off-by: Arend van Spriel <aspriel@gmail.com>
9 years agopython: capi: expose multicast membership functions
Arend van Spriel [Sun, 10 May 2015 10:20:06 +0000 (12:20 +0200)]
python: capi: expose multicast membership functions

Adding functions to add/drop membership to single multicast group.

Signed-off-by: Arend van Spriel <aspriel@gmail.com>
9 years agopython: disable swig debug print messages
Arend van Spriel [Wed, 6 May 2015 12:26:01 +0000 (14:26 +0200)]
python: disable swig debug print messages

The define was left enabled during development on netlink (and genl)
python swig api. It is a bit annoying in production release so disable
the define.

Signed-off-by: Arend van Spriel <aspriel@gmail.com>
9 years agoxfrm: fix potential NULL dereference
Tobias Klauser [Mon, 11 May 2015 12:49:01 +0000 (14:49 +0200)]
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>
9 years agoroute/tc: remove unnecessary check for tc_kind member of struct rtnl_tc
Tobias Klauser [Tue, 28 Apr 2015 11:36:40 +0000 (13:36 +0200)]
route/tc: remove unnecessary check for tc_kind member of struct rtnl_tc

The tc_kind member of struct rtnl_tc (and all types which can be
converted to it) is defined as an array and can thus never be
NULL.

http://lists.infradead.org/pipermail/libnl/2015-April/001869.html

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoutils: Add translations for NETLINK_RDMA and NETLINK_CRYPTO
Tobias Klauser [Mon, 27 Apr 2015 15:01:07 +0000 (17:01 +0200)]
utils: Add translations for NETLINK_RDMA and NETLINK_CRYPTO

Add translations for NETLINK_RDMA and NETLINK_CRYPTO to nlfamilies,
allowing to use nl_nlfamily2str() and nl_str2nlfamily() for these
families.

This makes it necessary to update the private copy of linux/netlink.h
and also includes the rename of NETLINK_INET_DIAG to NETLINK_SOCK_DIAG
in upstream commit 7f1fb60c4fc9fb29 ("inet_diag: Partly rename inet_ to
sock_") and the removal of the duplicate NLMSG_ALIGN in the
NLMSG_LENGTH() macro in upstream commit a88b9ce5ad4fc633 ("netlink:
remove duplicated NLMSG_ALIGN").

http://lists.infradead.org/pipermail/libnl/2015-April/001868.html

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agolibnl-3.2.26 release libnl3_2_26
Thomas Haller [Mon, 30 Mar 2015 11:17:17 +0000 (13:17 +0200)]
libnl-3.2.26 release

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoneigh: add support for NDA_VLAN nl attribute
Jonas Johansson [Thu, 19 Mar 2015 19:15:52 +0000 (20:15 +0100)]
neigh: add support for NDA_VLAN nl attribute

[thaller@redhat.com: modified patch to parse NDA_VLAN and diff vlan]

http://lists.infradead.org/pipermail/libnl/2015-March/001861.html

Signed-off-by: Jonas Johansson <jonasj76@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoroute/link: fix indention in inet6_dump_details()
Thomas Haller [Sun, 22 Mar 2015 19:55:34 +0000 (20:55 +0100)]
route/link: fix indention in inet6_dump_details()

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoutils: add code comment about capability number assignment
Thomas Haller [Thu, 19 Mar 2015 11:22:12 +0000 (12:22 +0100)]
utils: add code comment about capability number assignment

Also reserve a range of capabilities (0x7000 to 0x7FFF) that we won't
use upstream. Add a macro NL_CAPABILITY_IS_USER_RESERVED() to check
if the capability is in that range.

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agobuild: extend configure option --enable-cli and install all cli programs
Thomas Haller [Wed, 18 Mar 2015 14:20:28 +0000 (15:20 +0100)]
build: extend configure option --enable-cli and install all cli programs

Previously, some cli programs were installed to sbin/
and most were not installed at all.

Now, by default install all of them to bin/ directory.
But extend the configure option to allow specifying
'no-inst', 'bin', or 'sbin'.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agobuild/trivial: sort PROGRAMS list in src/Makefile.am
Thomas Haller [Wed, 18 Mar 2015 08:42:46 +0000 (09:42 +0100)]
build/trivial: sort PROGRAMS list in src/Makefile.am

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute: remove unnecessary include of private linux/if.h
David Chappelle [Tue, 17 Mar 2015 04:40:20 +0000 (00:40 -0400)]
route: remove unnecessary include of private linux/if.h

Including linux/if.h in netlink/route/link.h causes issues
in cases where libnl is used in conjuntion with other third
party libraries that include net/if.h. Seems to be a long
checkered history of symbol collisions between these two
files. As it turns out, including linux/if.h from within
netlink/route/link.h is actually unecessary. I resurrected
a forgotten path from this thread:

    http://lists.infradead.org/pipermail/libnl/2012-April/000525.html

By removing the include as the patch suggests we can get
around the nuissance of the symbol collisions.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agobuild: revert moving unstable symbols from libnl_3 linker section
Thomas Haller [Mon, 9 Mar 2015 16:16:56 +0000 (17:16 +0100)]
build: revert moving unstable symbols from libnl_3 linker section

In the past, libnl3 had only one section (libnl_3) in the
linker version script. Between 3.2.25 and 3.2.26 release,
this was cleaned up and new symbols were added to libnl_3_2_26
section. Commit d2a30fb also moved new symbols since 3.2.25
to that section.

Fedora 21 and later already uses these symbols in the previous
version (@libnl_3). Updating there would break symbol lookup.

As we have users of the unstable version from pre-3.2.26, move
those symbols back. Note that this now breaks unstable users since
d2a30fb (5 weeks ago) -- which probably are much fewer affected
users.

Fixes: d2a30fbb36d668fe64f43bddfc9c53ee0362334f
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agolib/socket: detect protocol in nl_socket_set_fd()
Thomas Haller [Fri, 6 Mar 2015 11:33:49 +0000 (12:33 +0100)]
lib/socket: detect protocol in nl_socket_set_fd()

With support for socket option SO_PROTOCOL we don't need the protocol
argument to nl_socket_set_fd(). Maybe we should drop the protocol argument
and just not support nl_socket_set_fd() on older systems. But instead
keep the argument and allow passing -1 to autodetect it.

If the user sets a protocol option, we check via getsockopt() that the
value is correct and error out otherwise.

On older kernels, the user must set the value. Otherwise
nl_socket_set_fd() will fail.

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agolibnl-3.2.26-rc1 release libnl3_2_26rc1
Thomas Haller [Thu, 5 Mar 2015 19:25:30 +0000 (20:25 +0100)]
libnl-3.2.26-rc1 release

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agobuild: fix path to linker version scripts for out-of-tree build
Thomas Haller [Thu, 5 Mar 2015 17:52:04 +0000 (18:52 +0100)]
build: fix path to linker version scripts for out-of-tree build

Fixes: e7d57da0ddad9097962ebfec4f5202b756ed93c9
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agolib/socket: add nl_socket_set_fd() function
Thomas Haller [Thu, 5 Mar 2015 09:39:43 +0000 (10:39 +0100)]
lib/socket: add nl_socket_set_fd() function

This is based on the patch by sagil@infinidat.com, but heavily modified.

Add a function nl_socket_set_fd(), I renamed it from nl_connect_fd().

Now nl_connect() and nl_socket_set_fd() are implemented independently as
they share little code. But they have similar functionality:
to initialize a libnl socket and set it's file descriptor.

A user who wants libnl to setup the socket can continue to use nl_connect().
A user with special requirements should setup the socket entirely. That includes
calling socket() (with or without SOCK_CLOEXEC), bind(), setting buffer size.

For the same reason I dropped nl_create_fd(). It didn't do much more then
calling socket() -- which the user can do directly.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoadd socket nl_connect_fd() & nl_create_fd()
Sagi Lowenhardt [Tue, 17 Feb 2015 13:22:27 +0000 (15:22 +0200)]
add socket nl_connect_fd() & nl_create_fd()

-    Added option to create socket (fd) without bind.
     It is now possible to forward the socket fd to another child process...
     ...later use nl_connect_fd() to connect to socket from the child process.

-    Added option to disable CLOEXEC even if defined (in socket.h)
     'nl_socket_enable_cloexec' & 'nl_socket_disable_cloexec'
     No change to current default behavior.

Signed-off-by: Sagi Lowenhardt <sagil@infinidat.com>
10 years agolib/nl: preserve s_local if nl_connect() fails
Thomas Haller [Thu, 5 Mar 2015 09:50:04 +0000 (10:50 +0100)]
lib/nl: preserve s_local if nl_connect() fails

s_local.nl_pid is used to track the generated port unless NL_OWN_PORT is set.
Ensure that getsockname() doesn't overwrite the value and possibly reset
the local port manually to release the generated port.

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agolib/socket: remove NL_SOCK_BUFSIZE_SET socket flag
Thomas Haller [Thu, 5 Mar 2015 07:46:31 +0000 (08:46 +0100)]
lib/socket: remove NL_SOCK_BUFSIZE_SET socket flag

The flag was not actually used.

NL_SOCK_BUFSIZE_SET was only set by nl_socket_set_buffer_size().
Note that you can only call nl_socket_set_buffer_size() on a socket that
is already connected via nl_connect().

On first call, nl_connect() would always see NL_SOCK_BUFSIZE_SET unset, and
call nl_socket_set_buffer_size().

Since the flag was never unset, when trying to connect a socket a second
time, we would not set the buffer size again. Which was a bug.

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agodbg: save errno from modification in NL_DBG()
Thomas Haller [Thu, 5 Mar 2015 09:28:41 +0000 (10:28 +0100)]
dbg: save errno from modification in NL_DBG()

Evaluating the logging statement might overwrite the errno. Save and
restore it so that NL_DBG() preserves the errno.

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agocls: add rtnl_u32_get_classid() API
Cong Wang [Wed, 4 Mar 2015 06:05:34 +0000 (22:05 -0800)]
cls: add rtnl_u32_get_classid() API

[thaller@redhat.com: modified patch to use rtnl_tc_data_peek()]

http://lists.infradead.org/pipermail/libnl/2015-March/001841.html

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agobuild/trivial: reorder symbols in linker version scripts and add comment
Thomas Haller [Wed, 4 Mar 2015 14:27:14 +0000 (15:27 +0100)]
build/trivial: reorder symbols in linker version scripts and add comment

We export some symbols that are in private headers. We shouldn't do
that. Highlight them in the version script by grouping them and add
a comment.

We might want to hide these symbols later.

Some of these symbols symbols are used by libnl internal libraries.
So removing those is more complicated and only possible if we don't
required compatibility of different libnl libraries between each other
(i.e. that we require that within one installation the library versions
match).

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute/tc: add internal rtnl_tc_data_peek() function
Thomas Haller [Wed, 4 Mar 2015 13:15:34 +0000 (14:15 +0100)]
route/tc: add internal rtnl_tc_data_peek() function

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agocorrect --protocol option for nl-cls-* utilities
Cong Wang [Wed, 25 Feb 2015 06:09:54 +0000 (22:09 -0800)]
correct --protocol option for nl-cls-* utilities

Just in the help message.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoact: correct file path for mirred.c
Cong Wang [Wed, 25 Feb 2015 06:09:53 +0000 (22:09 -0800)]
act: correct file path for mirred.c

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agobuild: fix parallel make
Lubomir Rintel [Wed, 18 Feb 2015 12:01:36 +0000 (13:01 +0100)]
build: fix parallel make

Add missing inter-library dependencies.

Fixes: e7d57da0ddad9097962ebfec4f5202b756ed93c9
https://github.com/thom311/libnl/pull/69

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agopktloc: fix typo for tcp.flag.syn
Thomas Haller [Tue, 17 Feb 2015 07:42:53 +0000 (08:42 +0100)]
pktloc: fix typo for tcp.flag.syn

http://lists.infradead.org/pipermail/libnl/2015-February/001829.html
http://lists.infradead.org/pipermail/libnl/2015-February/001830.html

Reported-by: Georgi Chulkov <georgi@guinpen.eu>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agolib: log errors from platform
Lubomir Rintel [Sun, 25 Jan 2015 17:11:53 +0000 (18:11 +0100)]
lib: log errors from platform

nl_syserr2nlerr() reduces a lot of platform errors to NLE_FAILURE --
"Unspecific failure" which makes it somehow hard to track down the real reason
behind a failure.

Logging them with level of 4 makes it a little less painful.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agolib: add const-ness to appropriate parameters in addr, attr, data
Rohan Joyce [Fri, 13 Feb 2015 10:26:01 +0000 (18:26 +0800)]
lib: add const-ness to appropriate parameters in addr, attr, data

This patch changes the signatures of some functions to allow const pointers in
places where a const qualified pointer is enough access for what the function
does (e.g. nla_get_u8). It also changes some functions that take a pointer
parameter and return a pointer derived from it to use the strchr idiom.

This is not exhaustive in terms of places where const can be added, but it's
a decent chunk that should not make the external api any more restrictive.

http://lists.infradead.org/pipermail/libnl/2015-February/001826.html

Signed-off-by: Rohan Joyce <rojoyce.github@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute/tc: add rtnl_tc_stat2str() and rtnl_tc_str2stat()
Cong Wang [Thu, 29 Jan 2015 01:12:12 +0000 (17:12 -0800)]
route/tc: add rtnl_tc_stat2str() and rtnl_tc_str2stat()

[thaller@redhat.com: add symbols to libnl-route-3.sym]

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute/act: merge branch 'act-skbedit'
Thomas Haller [Mon, 2 Feb 2015 17:16:54 +0000 (18:16 +0100)]
route/act: merge branch 'act-skbedit'

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute/act: add a test case for skbedit action
Cong Wang [Wed, 28 Jan 2015 23:19:19 +0000 (15:19 -0800)]
route/act: add a test case for skbedit action

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute/act: add skbedit action
Cong Wang [Wed, 28 Jan 2015 23:19:18 +0000 (15:19 -0800)]
route/act: add skbedit action

[thaller@redhat.com: changed whitespace and libnl-route.sym]

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agobuild: merge branch 'symbol-versioning'
Thomas Haller [Mon, 2 Feb 2015 16:40:10 +0000 (17:40 +0100)]
build: merge branch 'symbol-versioning'

No longer export all symbols of the shared libraries
but pick them explicitly. Hide symbols that were
private and not part of a public header file.

This is an ABI change, but hopefully not too painful.

There are still symbols in the header files that should
be private. They continue to be exposed.

http://lists.infradead.org/pipermail/libnl/2015-January/001794.html

10 years agobuild: don't export internal symbols
Thomas Haller [Sun, 4 Jan 2015 16:24:40 +0000 (17:24 +0100)]
build: don't export internal symbols

Hide internal symbols from the libraries.
Before, all symbols were exported, including some that were
not meant to be public. Hide them now.

This is an ABI break, but nobody was supposed to use these symbols.
Hence it seems acceptable to hide them now.

Still don't hide any symbols that are internal, but wrongly exported
in public header files (such as @ct_obj_ops).

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agobuild: move linker script symbols since last stable release to own section
Thomas Haller [Sun, 4 Jan 2015 16:24:39 +0000 (17:24 +0100)]
build: move linker script symbols since last stable release to own section

Move the symbols that were added since the last stable release to a new
section of the linker file.

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agobuild: explicitly list exported symbols in linker scripts
Thomas Haller [Sun, 4 Jan 2015 16:24:38 +0000 (17:24 +0100)]
build: explicitly list exported symbols in linker scripts

Before all symbols (global: *;) were exported, which included some
symbols that should not be exported. Update the symbol files to
exclude everything by default and name the exported symbols
explicitly.

Still the same symbols as before are exported.

    for SO in ./lib/.libs/*.so ./src/lib/.libs/*.so; do
        SYM="$(basename "$SO")"
        SYM="${SYM%.so}.sym"
        cat <<EOF | sed 's/^ *>> //' > "$SYM"
            >> libnl_3 {
            >> global:
            >> $(nm "$SO" | sed -n 's/^[a-fA-F0-9]\+ [BDRT] \(.*\)/\t\1;/p' | LANG=C sort)
            >> local:
            >> $(echo -e '\t')*;
            >> };
    EOF
    done

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agobuild: add linker scripts for libnl-cli-3.so library
Thomas Haller [Sun, 4 Jan 2015 16:24:37 +0000 (17:24 +0100)]
build: add linker scripts for libnl-cli-3.so library

libnl-cli-3.so was unversioned previously. This is an
ABI change (but backward compatible).

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agobuild: add individual linker version scripts for shared libraries
Thomas Haller [Sun, 4 Jan 2015 16:24:36 +0000 (17:24 +0100)]
build: add individual linker version scripts for shared libraries

Instead of using a shared version script 'libnl.sym', add individual
linker scripts for all libnl libraries.

For now, the content of the version script is unchanged and this
patch does not have any externally visible changes.

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agopython: fix package meta data in setup.py
Thomas Haller [Mon, 5 Jan 2015 11:12:25 +0000 (12:12 +0100)]
python: fix package meta data in setup.py

http://lists.infradead.org/pipermail/libnl/2015-January/001802.html

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agobuild: mark header linux-private/linux/veth.h as noinst_HEADERS
Thomas Haller [Tue, 9 Dec 2014 16:47:51 +0000 (17:47 +0100)]
build: mark header linux-private/linux/veth.h as noinst_HEADERS

Fixes: 9dc6e6da90016a33929f262bea0187396e1a061b
10 years agoidiag: fix set of identifying properties for idiag_msg_obj
Thomas Haller [Wed, 26 Nov 2014 11:34:55 +0000 (12:34 +0100)]
idiag: fix set of identifying properties for idiag_msg_obj

The key for a struct idiag_msg_obj should be
'family x src x dst x sport x dport'.

http://lists.infradead.org/pipermail/libnl/2014-November/001768.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: merge branch 'idiag-compare-all'
Thomas Haller [Thu, 27 Nov 2014 15:56:42 +0000 (16:56 +0100)]
idiag: merge branch 'idiag-compare-all'

oo_compare() is also relevant for nl_object_diff() and nl_object_filter().
Compare all fields so that comparing idiag_meminfo_obj works properly.

http://lists.infradead.org/pipermail/libnl/2014-November/001783.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: fix idiagnl_compare() to compare all attributes
Thomas Haller [Thu, 27 Nov 2014 12:09:05 +0000 (13:09 +0100)]
idiag: fix idiagnl_compare() to compare all attributes

This is not important for nl_object_identical() which only considers
the required attributes. But for using nl_object_diff() or nl_object_filter(),
all attributes must be compared.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: make objects 'idiag_vegasinfo' and 'idiag_meminfo' comparable
Thomas Haller [Thu, 27 Nov 2014 12:09:04 +0000 (13:09 +0100)]
idiag: make objects 'idiag_vegasinfo' and 'idiag_meminfo' comparable

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: don't dump unset properties of idiag_msg
Thomas Haller [Thu, 27 Nov 2014 12:09:03 +0000 (13:09 +0100)]
idiag: don't dump unset properties of idiag_msg

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute/addr: consider CACHEINFO in addr_compare()/nl_object_diff()
Thomas Haller [Thu, 27 Nov 2014 10:38:26 +0000 (11:38 +0100)]
route/addr: consider CACHEINFO in addr_compare()/nl_object_diff()

Indicate this change of behavior with the capability
NL_CAPABILITY_ROUTE_ADDR_COMPARE_CACHEINFO.

This is a behavioral change as we now consider an additional
field when comparing addresses.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoobject: fix returning UINT_MAX for uint32_t in nl_object_diff()
Thomas Haller [Thu, 27 Nov 2014 11:00:41 +0000 (12:00 +0100)]
object: fix returning UINT_MAX for uint32_t in nl_object_diff()

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute: merge branch 'route-link-get-kernel-opnotsupp'
Thomas Haller [Thu, 27 Nov 2014 09:33:11 +0000 (10:33 +0100)]
route: merge branch 'route-link-get-kernel-opnotsupp'

http://lists.infradead.org/pipermail/libnl/2014-November/001769.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute/link: return -NLE_OPNOTSUPP in rtnl_link_get_kernel() for old kernels
Thomas Haller [Wed, 26 Nov 2014 17:17:16 +0000 (18:17 +0100)]
route/link: return -NLE_OPNOTSUPP in rtnl_link_get_kernel() for old kernels

Older kernels without patch a3d1289126e7b14307074b76bf1677015ea5036f do
not support rtnl_getlink() by ifname. Detect this situation and fail
with -NLE_OPNOTSUPP instead of -NLE_INVAL.

This changes behavior in returning a different error code for this
case.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agonl: add function nl_pickup_keep_syserr()
Thomas Haller [Wed, 26 Nov 2014 17:13:37 +0000 (18:13 +0100)]
nl: add function nl_pickup_keep_syserr()

nl_pickup() converts error codes from netlink into
nl error codes using nl_syserr2nlerr(). The latter function
mangles different error codes to the same nl error code.

Add a new function, that returns both the nl error code
and the original error code.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agotrival: white space fix in lib/nl.c
Thomas Haller [Wed, 26 Nov 2014 17:13:36 +0000 (18:13 +0100)]
trival: white space fix in lib/nl.c

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: merge branch 'idiag-exts2str-fix'
Thomas Haller [Tue, 25 Nov 2014 11:31:20 +0000 (12:31 +0100)]
idiag: merge branch 'idiag-exts2str-fix'

http://lists.infradead.org/pipermail/libnl/2014-November/001762.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: fix idiagnl_exts2str()
Thomas Haller [Tue, 25 Nov 2014 10:35:03 +0000 (11:35 +0100)]
idiag: fix idiagnl_exts2str()

idiagnl_exts2str() is used to print req->idiag_ext,
which is the extention types combined as flags, such as
( (1 << (INET_DIAG_TOS - 1)) | (1 << (INET_DIAG_MEMINFO - 1)) ).

This function was wrong from the beginning because the string lookup
array had indexes such as 'INET_DIAG_TOS', instead of '(1 << (INET_DIAG_TOS - 1)'.

Fix also idiagnl_attrs2str() which now converts an extension
type (e.g. INET_DIAG_TOS) to a string. Still this function is
deprecated, as the function name is not clear and it is not
used or very useful.

Fixes: 22eb2569a595be98ae09fc4192860c1d2c3aa54c
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: add missing enum types for idiagnl_exts2str()
Thomas Haller [Tue, 25 Nov 2014 10:35:02 +0000 (11:35 +0100)]
idiag: add missing enum types for idiagnl_exts2str()

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agocache: assert in nl_cache_mngt_register() for valid oo_keygen() function
Thomas Haller [Mon, 24 Nov 2014 18:04:50 +0000 (19:04 +0100)]
cache: assert in nl_cache_mngt_register() for valid oo_keygen() function

oo_keygen() requires oo_compare(). Assert in nl_cache_mngt_register().

http://lists.infradead.org/pipermail/libnl/2014-November/001759.html

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: merge branch 'idiag-fixes'
Thomas Haller [Mon, 24 Nov 2014 17:41:39 +0000 (18:41 +0100)]
idiag: merge branch 'idiag-fixes'

Deprecate all of the IDIAG_* defines in 'idiagnl.h'.
Names exposed by libnl should have the prefix IDIAGNL_*
instead.

But actually, most of these values were copies from other
system headers. The user should instead use the original defines
anyway.

Also, several fixes of the idiag_msg_obj, which had a broken
oo_clone() function and missing oo_compare().

http://lists.infradead.org/pipermail/libnl/2014-November/001726.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: add a oo_compare() function for idiag_msg objects
Thomas Haller [Mon, 24 Nov 2014 16:14:57 +0000 (17:14 +0100)]
idiag: add a oo_compare() function for idiag_msg objects

Having a oo_keygen() function only makes sense together with a
oo_compare() function because after hashing, you still have to compare
the objects for equality (in case of hash collission).

Fixes: 9c066b9271493ce3efff0b9d7b6e424990bba3f2
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: add change attributes for idiag_msg_obj
Thomas Haller [Mon, 24 Nov 2014 16:14:56 +0000 (17:14 +0100)]
idiag: add change attributes for idiag_msg_obj

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: remove clone functions from trivial structures
Thomas Haller [Mon, 24 Nov 2014 16:14:55 +0000 (17:14 +0100)]
idiag: remove clone functions from trivial structures

A oo_clone() function is only needed for complex sturctures
to deep copy an object.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: fix idiagnl_msg_clone()
Thomas Haller [Mon, 24 Nov 2014 16:14:54 +0000 (17:14 +0100)]
idiag: fix idiagnl_msg_clone()

For one, we did not clone all pointer values. Hence, every cloned
object was very broken and resulted in dangling pointers and
double free/unref.

Apparently nobody was really using this function up to now.

Also, fix the return cases for NLE_NOMEM, so that we did not assume
ownership of pointers in 'src'.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: fix memory leak in idiagnl_msg_set_cong()
Thomas Haller [Mon, 24 Nov 2014 16:14:53 +0000 (17:14 +0100)]
idiag: fix memory leak in idiagnl_msg_set_cong()

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: reorder idiagnl.h to have deprecated functions at the top
Thomas Haller [Mon, 24 Nov 2014 16:14:52 +0000 (17:14 +0100)]
idiag: reorder idiagnl.h to have deprecated functions at the top

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: deprecate IDIAG_TIMER_* value for IDIAGNL_TIMER_*
Thomas Haller [Mon, 24 Nov 2014 16:14:51 +0000 (17:14 +0100)]
idiag: deprecate IDIAG_TIMER_* value for IDIAGNL_TIMER_*

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: deprecate IDIAG_SS_* socket states
Thomas Haller [Mon, 24 Nov 2014 16:14:50 +0000 (17:14 +0100)]
idiag: deprecate IDIAG_SS_* socket states

These values mirror TCP_* socket states from 'netinit/tcp.h'.
There is no good reason to expose a copy of those values.
User space should use the original values (if they care).
The only value that is actually useful is IDIAGNL_SS_ALL.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: deprecate netlink message type defines in idiagnl.h
Thomas Haller [Mon, 24 Nov 2014 16:14:49 +0000 (17:14 +0100)]
idiag: deprecate netlink message type defines in idiagnl.h

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: deprecate IDIAG_ATTR_* enumeration
Thomas Haller [Mon, 24 Nov 2014 16:14:48 +0000 (17:14 +0100)]
idiag: deprecate IDIAG_ATTR_* enumeration

IDIAG_ATTR_* were a copy of the INET_DIAG_* extension kernel
flags. Redefining them is wrong, user space should continue
to use the values provided via the kernel headers.

Also they were misused as change flags (ce_mask), which they are not.

Deprecate the IDIAG_ATTR_* flags and redefine them to what the
originally are: INET_DIAG_*.

Also deprecated idiagnl_attrs2str() because there is already
idiagnl_exts2str(). idiagnl_attrs2str() in the sense of libnl change
flags (ce_mask) makes no sense.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: deprecate idiagnl_msg_obj_ops variable in public API
Thomas Haller [Mon, 24 Nov 2014 16:14:47 +0000 (17:14 +0100)]
idiag: deprecate idiagnl_msg_obj_ops variable in public API

This internal structure should never have been exposed publically.
It as introduced as public API in v3.2.23.

For now, don't remove it as it would be an API/ABI break.

Fixes: 81d2b1d509d91fe894e4aec0a6a76b0bf75514cd
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: fix out of bound error parsing idiag messages
Thomas Haller [Mon, 24 Nov 2014 16:14:46 +0000 (17:14 +0100)]
idiag: fix out of bound error parsing idiag messages

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: add copy of kernel header include/linux/inet_diag.h
Thomas Haller [Mon, 24 Nov 2014 16:14:45 +0000 (17:14 +0100)]
idiag: add copy of kernel header include/linux/inet_diag.h

Taken from upstream kernel commit bfe01a5ba2490f299e1d2d5508cbbbadd897bbe9
(v3.17), file 'include/uapi/linux/inet_diag.h'.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute: merge branch 'route-tc-fixes'
Thomas Haller [Mon, 24 Nov 2014 17:23:02 +0000 (18:23 +0100)]
route: merge branch 'route-tc-fixes'

http://lists.infradead.org/pipermail/libnl/2014-November/001738.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute: make rtnl_tc_clone() more robust against NLE_NOMEM
Thomas Haller [Mon, 24 Nov 2014 16:19:54 +0000 (17:19 +0100)]
route: make rtnl_tc_clone() more robust against NLE_NOMEM

When oo_clone() fails, the new object is freed. Make sure 'dst'
does not own parts of 'src'.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute: set missing TCA_ATTR_XSTATS changes flags in rtnl_tc_msg_parse()
Thomas Haller [Mon, 24 Nov 2014 16:19:53 +0000 (17:19 +0100)]
route: set missing TCA_ATTR_XSTATS changes flags in rtnl_tc_msg_parse()

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: add a copy of linux/sock_diag.h
Cong Wang [Mon, 27 Oct 2014 16:50:17 +0000 (09:50 -0700)]
idiag: add a copy of linux/sock_diag.h

When we test idiag on 3.4 kernel, we always get ERANGE.
This is because libnl has its own copy for SK_MEMINFO_*,
which is actually newer than 3.4, where SK_MEMINFO_VARS
is larger than kernel's.

We add a copy from latest kernel, so on older kernel
libnl should still compile. Note, for kernel < 3.6
we don't have SK_MEMINFO_BACKLOG, we have to relax
the minlen.

'sock_diag.h' comes from v3.17 kernel sources
(bfe01a5ba2490f299e1d2d5508cbbbadd897bbe9), file
'include/uapi/linux/sock_diag.h'.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoidiag: provide a hash function for idiag objects
Cong Wang [Thu, 20 Nov 2014 20:26:01 +0000 (12:26 -0800)]
idiag: provide a hash function for idiag objects

Without ->oo_keygen, libnl will use linear search
for cache objects. This is extremely slow for idiag
when we have a lot of TCP connections. Provide a
hash function for idiag so that libnl will be able
to lookup a hashtable.

http://lists.infradead.org/pipermail/libnl/2014-November/001715.html

Cc: Thomas Graf <tgraf@suug.ch>
Cc: Thomas Haller <thaller@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agocache: avoid duplicate check on initial dump
Holger Eitzenberger [Sun, 23 Nov 2014 14:40:36 +0000 (15:40 +0100)]
cache: avoid duplicate check on initial dump

The cache pickup does a check for duplicates for some time now.

However, the pickup in nl_cache_refill() explicitely clears the
cache, so the pickup doesn't need to actually do the dupe check,
as uniqueness is already guaranteed be Netlink subsystem.

And avoiding the dup check is beneficitial for performance
reasons, as the current algorithm is O(n^2).

http://lists.infradead.org/pipermail/libnl/2014-October/001680.html

Fixes: 96bb7c9a4cdd10a2665c0f56120943e79e33c560
Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute/cls: merge branch 'route-cls-u32-match-mark'
Thomas Haller [Sun, 23 Nov 2014 14:32:41 +0000 (15:32 +0100)]
route/cls: merge branch 'route-cls-u32-match-mark'

http://lists.infradead.org/pipermail/libnl/2014-November/001699.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute/cls: minor fixes in for match mark filters
Thomas Haller [Sun, 23 Nov 2014 14:25:01 +0000 (15:25 +0100)]
route/cls: minor fixes in for match mark filters

- whitespace
- fix newline and whitespace in output of u32_dump_details()
- let rtnl_u32_del_mark() clear U32_ATTR_MARK

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute/cls: support 'match mark' u32 filters
Sagi Lowenhardt [Mon, 10 Nov 2014 15:51:41 +0000 (07:51 -0800)]
route/cls: support 'match mark' u32 filters

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agolink: fix memory leaks due to repeated calls to .io_alloc()
Thomas Haller [Mon, 18 Aug 2014 13:24:30 +0000 (15:24 +0200)]
link: fix memory leaks due to repeated calls to .io_alloc()

All the io_alloc() implementation unconditionally allocated
new memory, thus leaking memory if called more then once.
Fix io_alloc() implementations not to allocate new memory
if not needed.

This happens for example in link_msg_parser() which first
calls rtnl_link_set_type():

    #0  macvlan_alloc (link=0x609d50) at route/link/macvlan.c:56
    #1  0x00007ffff7b99a78 in rtnl_link_set_type (link=link@entry=0x609d50, type=type@entry=0x609a94 "macvlan") at route/link.c:2233
    #2  0x00007ffff7b99c28 in link_msg_parser (ops=<optimized out>, who=<optimized out>, n=<optimized out>, pp=0x7fffffffd870) at route/link.c:547
    #3  0x00007ffff7dea109 in nl_cache_parse (ops=0x7ffff7dd8600 <rtnl_link_ops>, who=0x603338, nlh=0x6098a0, params=0x7fffffffd870) at cache.c:914
    #4  0x00007ffff7dea15b in update_msg_parser (msg=<optimized out>, arg=<optimized out>) at cache.c:668
    #5  0x00007ffff7def7bf in nl_cb_call (msg=<optimized out>, type=<optimized out>, cb=<optimized out>) at ../include/netlink-private/netlink.h:142
    #6  recvmsgs (cb=0x6057a0, sk=0x6034c0) at nl.c:952
    #7  nl_recvmsgs_report (sk=sk@entry=0x6034c0, cb=cb@entry=0x6057a0) at nl.c:1003
    #8  0x00007ffff7defb79 in nl_recvmsgs (sk=sk@entry=0x6034c0, cb=cb@entry=0x6057a0) at nl.c:1027
    #9  0x00007ffff7de9668 in __cache_pickup (sk=0x6034c0, cache=0x603510, param=param@entry=0x7fffffffd870) at cache.c:701
    #10 0x00007ffff7dea08d in nl_cache_pickup (sk=<optimized out>, cache=<optimized out>) at cache.c:753
    #11 0x0000000000400d56 in main ()

and later ops->io_parse():

    #0  macvlan_alloc (link=0x609d50) at route/link/macvlan.c:56
    #1  0x00007ffff7baae9d in macvlan_parse (link=0x609d50, data=<optimized out>, xstats=<optimized out>) at route/link/macvlan.c:79
    #2  0x00007ffff7b99c80 in link_msg_parser (ops=<optimized out>, who=<optimized out>, n=<optimized out>, pp=0x7fffffffd870) at route/link.c:567
    #3  0x00007ffff7dea109 in nl_cache_parse (ops=0x7ffff7dd8600 <rtnl_link_ops>, who=0x603338, nlh=0x6098a0, params=0x7fffffffd870) at cache.c:914
    #4  0x00007ffff7dea15b in update_msg_parser (msg=<optimized out>, arg=<optimized out>) at cache.c:668
    #5  0x00007ffff7def7bf in nl_cb_call (msg=<optimized out>, type=<optimized out>, cb=<optimized out>) at ../include/netlink-private/netlink.h:142
    #6  recvmsgs (cb=0x6057a0, sk=0x6034c0) at nl.c:952
    #7  nl_recvmsgs_report (sk=sk@entry=0x6034c0, cb=cb@entry=0x6057a0) at nl.c:1003
    #8  0x00007ffff7defb79 in nl_recvmsgs (sk=sk@entry=0x6034c0, cb=cb@entry=0x6057a0) at nl.c:1027
    #9  0x00007ffff7de9668 in __cache_pickup (sk=0x6034c0, cache=0x603510, param=param@entry=0x7fffffffd870) at cache.c:701
    #10 0x00007ffff7dea08d in nl_cache_pickup (sk=<optimized out>, cache=<optimized out>) at cache.c:753
    #11 0x0000000000400d56 in main ()

https://github.com/thom311/libnl/issues/59

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agolink/inet6: add support for tokenized interface identifiers
Lubomir Rintel [Fri, 26 Sep 2014 21:19:43 +0000 (23:19 +0200)]
link/inet6: add support for tokenized interface identifiers

http://tools.ietf.org/html/draft-chown-6man-tokenised-ipv6-identifiers-02

[thaller@redhat.com: Add OOM handling, fix whitespace issues]

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

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agonetlink/netlink.h: fix build including <poll.h> with the musl C library
Jörg Krause [Mon, 1 Sep 2014 10:38:10 +0000 (12:38 +0200)]
netlink/netlink.h: fix build including <poll.h> with the musl C library

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agobuild: move copy of linux headers to private directory
Thomas Haller [Wed, 24 Sep 2014 05:49:34 +0000 (07:49 +0200)]
build: move copy of linux headers to private directory

libnl3 contains a private copy of some kernel header files.

Normally, users are expected to install libnl and specify
-I$PREFIX/include/libnl3 as include path. As the private kernel
header files are not installed, this works fine.

However, it can be convenient to build against the libnl source
directory, without installing libnl. In this case, the private kernel
header files shaddow the system provided ones. This is undesired.

Move these files to a different directory to avoid this clash.

http://lists.infradead.org/pipermail/libnl/2014-September/001645.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
10 years agobuild/trivial: prettify makefiles by wrapping long lines
Thomas Haller [Wed, 24 Sep 2014 05:49:33 +0000 (07:49 +0200)]
build/trivial: prettify makefiles by wrapping long lines

Signed-off-by: Thomas Haller <thaller@redhat.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
10 years agoidiag: fix a typo in idiagnl_req_set_ifindex()
Cong Wang [Tue, 23 Sep 2014 17:00:06 +0000 (10:00 -0700)]
idiag: fix a typo in idiagnl_req_set_ifindex()

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agobuild: generate libnl-idiag-3.0.pc
Sébastien Barré [Thu, 18 Sep 2014 10:17:39 +0000 (12:17 +0200)]
build: generate libnl-idiag-3.0.pc

That file was not generated due to a missing line in Makefile.am
and configure.ac

http://lists.infradead.org/pipermail/libnl/2014-September/001649.html

Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoMerge branch 'enovance-sa_fixup'
Thomas Haller [Wed, 27 Aug 2014 11:24:35 +0000 (13:24 +0200)]
Merge branch 'enovance-sa_fixup'

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

[thaller@redhat.com: I changed the original patches
 to indent with tabs (vs. spaces) and reworded the
 commit messages.]

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agocls: check data before memcpy() it
Nicolas PLANEL [Tue, 26 Aug 2014 15:43:49 +0000 (11:43 -0400)]
cls: check data before memcpy() it

[thaller@redhat.com: I modified the condition "if (data && len)"
 in the original patch to just check "len > 0".
 Note that all call sites of meta_alloc() make sure to pass a
 valid data pointer with a non-zero length (anything else would
 be a bug). But indeed, calling memcpy with invalid src pointer
 is undefined behavior, even if len is zero.]

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoxfrm: fix xfrm_sa_msg_parser() to return the value from the callback
Nicolas PLANEL [Tue, 26 Aug 2014 15:34:40 +0000 (11:34 -0400)]
xfrm: fix xfrm_sa_msg_parser() to return the value from the callback

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoxfrm: fix an unintialized return value on memory allocation error in xfrmnl_ae_parse()
Nicolas PLANEL [Tue, 26 Aug 2014 15:31:15 +0000 (11:31 -0400)]
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>
10 years agoqdisc: avoid calling strstr() with a NULL haystack
Nicolas PLANEL [Tue, 26 Aug 2014 15:21:12 +0000 (11:21 -0400)]
qdisc: avoid calling strstr() with a NULL haystack

Signed-off-by: Thomas Haller <thaller@redhat.com>