]> granicus.if.org Git - libnl/log
libnl
9 years agoroute/link: add missing newlines after debug messages
Beniamino Galvani [Mon, 5 Oct 2015 08:55:39 +0000 (10:55 +0200)]
route/link: add missing newlines after debug messages

http://lists.infradead.org/pipermail/libnl/2015-October/001977.html

Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agolib/attr: add nla utility functions for signed integers
Thomas Haller [Mon, 5 Oct 2015 14:52:07 +0000 (16:52 +0200)]
lib/attr: add nla utility functions for signed integers

Commit 7bb956501ccd58ed3bbffc59de996f056e178683 added nla functions for
s32. We preferibly add all signed integer operations at the same time.
Thus, also add s8, s16, and s64.

Also, previously the NLA_TYPE_MAX enum was not extended to have
NLA_S32. Fix that too.

Reported-By: Jiri Pirko <jiri@resnulli.us>
Fixes: 7bb956501ccd58ed3bbffc59de996f056e178683
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoroute: add capability indicating the behavior of rtnl_neigh_get()
Thomas Haller [Tue, 29 Sep 2015 16:32:23 +0000 (18:32 +0200)]
route: add capability indicating the behavior of rtnl_neigh_get()

A wrong behavior for rtnl_neigh_get() was introduced between 3.2.14 and 3.2.15
(commit 64fcb47a36ec12d7e7f00605f6a8952ce985dd08).

It was later fixed between 3.2.21 and 3.2.22
(commit 8571f58f23763d8db7365d02c9b27832ad3d7005).

Add a capability NL_CAPABILITY_RTNL_NEIGH_GET_FILTER_AF_UNSPEC_FIX
to indicate that this buggy behavior was fixed.

https://bugzilla.redhat.com/show_bug.cgi?id=1261028
http://lists.infradead.org/pipermail/libnl/2015-August/001951.html
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agolibnl-3.2.27-rc1 release libnl3_2_27rc1
Thomas Haller [Mon, 21 Sep 2015 10:38:48 +0000 (12:38 +0200)]
libnl-3.2.27-rc1 release

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agolibnl: report an error if unexpected control data was received
Andrey Vagin [Mon, 14 Sep 2015 15:59:58 +0000 (18:59 +0300)]
libnl: report an error if unexpected control data was received

Currently, we try to handle MSG_CTRUNC, but if msg_controllen is zero, we make
double free for the same address.

realloc(0, 0) returns non-zero address
realloc(addr, 0) returns zero and free(addr) has already been called

Then we call free(addr) again and get an error like this:

*** Error in `./task_diag_all': double free or corruption (fasttop): 0x0000000000f9c160 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x77e9d)[0x7f360ed96e9d]
/lib64/libc.so.6(+0x7f53c)[0x7f360ed9e53c]
/lib64/libc.so.6(cfree+0x4c)[0x7f360eda2e9c]
/lib64/libnl-3.so.200(nl_recv+0x221)[0x7f360f2f6361]
/lib64/libnl-3.so.200(nl_recvmsgs_report+0x555)[0x7f360f2f6a95]
/lib64/libnl-3.so.200(nl_recvmsgs+0x9)[0x7f360f2f6d89]
./task_diag_all[0x400f8d]
/lib64/libc.so.6(__libc_start_main+0xf0)[0x7f360ed3f790]
./task_diag_all[0x401169]

http://lists.infradead.org/pipermail/libnl/2015-September/001965.html

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agodoc: enable generation of Doxygen tagfile for libnl API reference
Steffen Vogel [Sat, 19 Sep 2015 13:19:27 +0000 (15:19 +0200)]
doc: enable generation of Doxygen tagfile for libnl API reference

This enables other projects which are using Doxygen for documentation
to automatically create hyperlinks to libnl's API reference.

See: http://www.stack.nl/~dimitri/doxygen/manual/external.html

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

9 years agoroute/link: merge branch 'vlan-flags'
Thomas Haller [Thu, 3 Sep 2015 16:22:17 +0000 (18:22 +0200)]
route/link: merge branch 'vlan-flags'

http://lists.infradead.org/pipermail/libnl/2015-September/001961.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agovlan: add MVRP VLAN flag
Jiří Klimeš [Thu, 3 Sep 2015 12:23:53 +0000 (14:23 +0200)]
vlan: add MVRP VLAN flag

Kernel patch:   http://patchwork.ozlabs.org/patch/219040/
iproute2 patch: http://patchwork.ozlabs.org/patch/219364/

Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agovlan: add VLAN flags to trans_tbl to print them properly
Jiří Klimeš [Thu, 3 Sep 2015 12:23:52 +0000 (14:23 +0200)]
vlan: add VLAN flags to trans_tbl to print them properly

nl-link-list only showed reorder_hdr.

$ ip -d link show dev em1.444
28: em1.444@em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
    link/ether 3c:97:0e:58:1d:c1 brd ff:ff:ff:ff:ff:ff promiscuity 0
    vlan protocol 802.1Q id 444 <REORDER_HDR,GVRP,LOOSE_BINDING>
      ingress-qos-map { 1:3 4:2 }
      egress-qos-map { 2:6 9:5 }
$ /usr/sbin/nl-link-list --details -i 28
em1.444 ether 3c:97:0e:18:2e:a1 <broadcast,multicast,up,running,lowerup> slave-of em1 group 0 vlan-id 444
    mtu 1500 txqlen 0 weight 0 qdisc noqueue index 28
    txq 1 rxq 1 brd ff:ff:ff:ff:ff:ff state up mode default carrier up
    vlan-info id 444 <reorder_hdr,>    vlan protocol <129>
      ingress vlan prio -> qos/socket prio mapping:
      1 -> 0x000003, 4 -> 0x000002,
      egress qos/socket prio -> vlan prio mapping:
      0x000002 -> 6, 0x000009 -> 5,
  ...

Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoroute/link: add missing link_attrs translations
Tobias Klauser [Thu, 20 Aug 2015 13:46:22 +0000 (15:46 +0200)]
route/link: add missing link_attrs translations

Add LINK_ATTR_NSFD, LINK_ATTR_NS_PID and LINK_ATTR_LINK_NETNSID to the
link_attrs translation table after they were added in commits
760bfabad8cd ("add link netns support") and 66aab65595fb ("route/link:
add support for IFLA_LINK_NETNSID") respectively.

http://lists.infradead.org/pipermail/libnl/2015-August/001959.html

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agosocket: fix assertion in nl_connect() when all ports are already in use
Thomas Haller [Mon, 24 Aug 2015 15:57:16 +0000 (17:57 +0200)]
socket: fix assertion in nl_connect() when all ports are already in use

When generating a port fails a few times (because they are already in used
outside of libnl's knowledge), we would back off generating a local
port and instead let kernel decide.

There was however a bug in nl_connect() that caused an assertion:

    BUG at file position socket.c:147:_nl_socket_used_ports_release_all
    app: socket.c:147: _nl_socket_used_ports_release_all: Assertion `0' failed.

Fixes: 96e1e5bdc2e803700055395cc3c428fa2525d1ca
9 years agoroute/link: merge support for 'netnsid' (fixes)
Thomas Haller [Mon, 17 Aug 2015 15:11:56 +0000 (17:11 +0200)]
route/link: merge support for 'netnsid' (fixes)

Fix previous patches to have link_netnsid as signed int32_t.

http://lists.infradead.org/pipermail/libnl/2015-August/001941.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoroute/link: make link_netnsid argument (signed) int32_t
Thomas Haller [Mon, 17 Aug 2015 17:12:09 +0000 (19:12 +0200)]
route/link: make link_netnsid argument (signed) int32_t

Fixes: 66aab65595fb20bf166936fcfa4c8568b58f7f68
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agolib/attr: add nla utility functions for s32
Thomas Haller [Fri, 14 Aug 2015 15:32:36 +0000 (17:32 +0200)]
lib/attr: add nla utility functions for s32

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoroute/link: merge support for 'netnsid'
Thomas Haller [Mon, 17 Aug 2015 15:11:56 +0000 (17:11 +0200)]
route/link: merge support for 'netnsid'

http://lists.infradead.org/pipermail/libnl/2015-August/001941.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoroute/link: add support for IFLA_LINK_NETNSID
Thomas Haller [Fri, 14 Aug 2015 15:32:38 +0000 (17:32 +0200)]
route/link: add support for IFLA_LINK_NETNSID

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoinclude/linux: update copy of kernel header "if_link.h"
Thomas Haller [Fri, 14 Aug 2015 15:32:37 +0000 (17:32 +0200)]
include/linux: update copy of kernel header "if_link.h"

Taken from upstream kernel commit b953c0d234bc72e8489d3bf51a276c5c4ec85345
(v4.1), file 'include/uapi/linux/if_link.h' (after `make headers_install`).

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agolib/socket: in nl_socket_set_fd() always reset the local port
Thomas Haller [Fri, 14 Aug 2015 16:12:25 +0000 (18:12 +0200)]
lib/socket: in nl_socket_set_fd() always reset the local port

Even if the local port of @sk already equals to the port of
the file descriptor @fd, we want to release a possibly generated
port and set NL_OWN_PORT.

Fixes: 2d61e890379888907a93ddd0a04187b130629f6f
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoroute/link: Remove unnecessary NULL check before release_link_info()
Tobias Klauser [Tue, 14 Jul 2015 09:43:01 +0000 (11:43 +0200)]
route/link: Remove unnecessary NULL check before release_link_info()

release_link_info() already check whether link->l_info_ops is not NULL
before accessing it, thus there is no need to do the same before calling
it.

http://lists.infradead.org/pipermail/libnl/2015-July/001929.html

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agosocket: fix autogeneration of local ports for more then 1024 sockets
Thomas Haller [Fri, 14 Aug 2015 14:01:47 +0000 (16:01 +0200)]
socket: fix autogeneration of local ports for more then 1024 sockets

http://lists.infradead.org/pipermail/libnl/2015-June/001889.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agosocket: add fallback for nl_connect() by trying to bind to unspecified local port
Thomas Haller [Fri, 10 Jul 2015 12:58:51 +0000 (14:58 +0200)]
socket: add fallback for nl_connect() by trying to bind to unspecified local port

libnl allows the user to explicitly set the local port before connecting
the socket. A more convenient way is to leave the local port unspecified
and let libnl generate a port id.

As it is, generate_local_port() would try at most 1024 ports, that
means if a user tries to connect more sockets, the automatism will
fail.

Kernel also supports choosing the local port itself (via netlink_autobind()).
So, this could be fixed by always leaving the port unspecified and let
kernel decide on the port. For that we could entirely drop generate_local_port().

There are however problems with that:

  - it is unclear why generate_local_port() was even introduced in the
    first place instead of always relying kernel. This code already
    appeared in libnl-1, so maybe there was a good reason for it or
    it is necessary on some kernel versions.

  - The deprecated libnl-1 library also uses a form of generate_local_port().
    Its first guess would always be getpid(), but the problem is that
    it would not retry on EADDRINUSE. Currently libnl-3 generates ports in
    a different sequence and will not generate a conflicting port (until it
    already exhausted 1016 other ports).
    Hence, currently if your application uses libnl1 and libnl3
    together, the automatism might just work without conflicts
    (commit 1f734a8f892abcd3f81637df4a089155aca1b66a).
    Accidently, kernel/netlink_autobind() also first tries the process
    id as port. That means, if we change libnl-3 to leave the decision
    to kernel, and
      - the application connects sockets both via libnl-1 and libnl-3
      - and the libnl-3 socket happens to connect first
    then the libnl-1 socket would fail to connect without retrying
    another port.

  - Removing generate_local_port() entirely changes behavior in the
    following case:

        sk = nl_socket_alloc();
        /* accessing local port before connecting the socket used to
         * freeze the local port to the generated value. */
        port = nl_socket_get_local_port(sk);
        nl_connect(sk, NETLINK_...);

Maybe the issues are minor and it would simplify the code just to get
rid of the cruft. But instead fix the issue without changing behavior.
Just keep trying with generate_local_port() first, before fallback to
kernel.

Reported-by: Julien Courtat <julien.courtat@6wind.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
http://lists.infradead.org/pipermail/libnl/2015-June/001889.html

9 years agosocket: clear port when unable to generate local port
Thomas Haller [Fri, 10 Jul 2015 12:58:50 +0000 (14:58 +0200)]
socket: clear port when unable to generate local port

When running out of local ports, _nl_socket_generate_local_port_no_release()
would leave the socket with port UINT32_MAX. That means if nl_connect()
fails due to out-of-ports, it would leave the port id assigned to an
invalid port and the socket instance was not re-usable until the user
called nl_socket_set_local_port(). Fix that by resetting the local port
to zero.

Thereby, also change generate_local_port() to return zero when
running out of ports. zero is a more natural value for ~no port found~.
It also matches the port that _nl_socket_generate_local_port_no_release()
uses when failing to generate a port.

Also ensure that zero cannot be returned as valid port by generate_local_port().
Arguably, that would only be possible if (getpid() & 0x3FFFFF)
returns zero. Just be extra cautious.

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agolib/route: merge fixes to dump_details
Thomas Haller [Fri, 14 Aug 2015 13:25:27 +0000 (15:25 +0200)]
lib/route: merge fixes to dump_details

http://lists.infradead.org/pipermail/libnl/2015-July/001933.html
http://lists.infradead.org/pipermail/libnl/2015-July/001932.html
http://lists.infradead.org/pipermail/libnl/2015-July/001931.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoroute/qdisc: fixe printing whitespace in qdisc_dump_details()
Steffen Vogel [Fri, 24 Jul 2015 06:42:28 +0000 (08:42 +0200)]
route/qdisc: fixe printing whitespace in qdisc_dump_details()

And whitespace (source code) fix.

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoroute/tc: use plain format string in rtnl_tc_dump_stats()
Thomas Haller [Fri, 14 Aug 2015 13:17:30 +0000 (15:17 +0200)]
route/tc: use plain format string in rtnl_tc_dump_stats()

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoroute/tc: improved statistics dump (just alignment)
Steffen Vogel [Fri, 24 Jul 2015 06:42:27 +0000 (08:42 +0200)]
route/tc: improved statistics dump (just alignment)

9 digits for for B/s don't make sense to me. It's just breaks the alignment.

[thaller@redhat.com: whitespace fixes]

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoroute/qdisc: added more attributes to netem dump
Steffen Vogel [Fri, 24 Jul 2015 06:42:26 +0000 (08:42 +0200)]
route/qdisc: added more attributes to netem dump

I added all the netem attributes (except for limit) to the NL_DUMP_DETAILS section.

[thaller@redhat.com: whitespace fixes]

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agolib/nl: add missing header
Jörg Krause [Thu, 13 Aug 2015 11:34:13 +0000 (13:34 +0200)]
lib/nl: add missing header

CMSG_NXTHDR requires <linux/socket.h>. This fix a build error with the musl
C library:

```
undefined reference to `__cmsg_nxthdr'
```

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

9 years agoipvlan: fix return error code for rtnl_link_ipvlan_get_mode()
Thomas Haller [Fri, 10 Jul 2015 09:01:30 +0000 (11:01 +0200)]
ipvlan: fix return error code for rtnl_link_ipvlan_get_mode()

rtnl_link_ipvlan_get_mode() was just introduced as new API. Fix the
error code to return -NLE_INVAL instead of -NLE_OPNOTSUPP.

http://lists.infradead.org/pipermail/libnl/2015-June/001921.html

9 years agonf: fix potential bug in nfnl_queue_msg_set_payload() when malloc() failed
Коренберг Марк [Thu, 2 Jul 2015 09:59:55 +0000 (14:59 +0500)]
nf: fix potential bug in nfnl_queue_msg_set_payload() when malloc() failed

Suppose the case:
1. message have already some payload
2. malloc() failed

In that case:
1. msg->queue_msg_payload become NULL
2. msg->queue_msg_payload_len stay non-zero

Now when malloc() error occurs, nothing changed.

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

9 years agobuild: merge branch 'kolyshkin-build-cleanups'
Thomas Haller [Thu, 9 Jul 2015 20:49:19 +0000 (22:49 +0200)]
build: merge branch 'kolyshkin-build-cleanups'

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

9 years agodoc/Makefile.am: don't use asciidoc if disabled
Kir Kolyshkin [Tue, 7 Jul 2015 05:33:23 +0000 (22:33 -0700)]
doc/Makefile.am: don't use asciidoc if disabled

In case doc/configure.ac hasn't found asciidoc or any of its
prerequisites (such as pygmentize), make shouldn't try to run it.
One such case ("gendoc" target) is covered while the other
("%.html" target) is not. Fix it by adding a proper ifdef.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
9 years agodoc/configure.ac: simplify python check
Kir Kolyshkin [Tue, 7 Jul 2015 05:23:45 +0000 (22:23 -0700)]
doc/configure.ac: simplify python check

A check for python binary that was originally introduced by commit
183e869 is needed because python is used for a couple of preprocessors
(doxygen-link.py and resolve-asciidoc-refs.py) and therefore it is
impossible to build docs without python.

While it is right to check for python, the check was both wrong and
excessive. Instead of just checking for python binary, it checked for
various versions of python and set a few variables that are not needed
here. More to say, the absense of python binary was not treated as
being fatal like it should.

Fix both problems by using AC_CHECK_PROG for python, terminating the
build in the same way as with doxygen absense. Also, remove the
m4/ax_python.m4 which is no longer needed.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
9 years agom4/ax*.m4: remove
Kir Kolyshkin [Tue, 7 Jul 2015 00:25:14 +0000 (17:25 -0700)]
m4/ax*.m4: remove

These files, as well as the proper configure.ac calls, were added
by commit f443be6, but the calls were later removed by commit b4b853e,
so these are no longer needed.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
9 years agom4/ax_python.m4: remove
Kir Kolyshkin [Tue, 7 Jul 2015 00:15:15 +0000 (17:15 -0700)]
m4/ax_python.m4: remove

This file is no longer needed since commit db13843 which copied it
to doc/ subdir and removed the call to AX_PYTHON from configure.ac.

That commit should have moved it rather than copied, let's fix it.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
9 years agolink: set ifi_change in link message
matben2 [Thu, 9 Jul 2015 05:40:18 +0000 (17:40 +1200)]
link: set ifi_change in link message

The ifi_change field can be set with the mask of the flags that need
to be changed as part of the link message to the kernel. This means only
the specific flags that have been changed will be modified in the kernel,
rather than the entire flags entry.

[thaller@redhat.com: add capability to indicate the change in behavior]

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

9 years agoipvlan: don't check for valid @mode argument in rtnl_link_ipvlan_set_mode()
Thomas Haller [Fri, 26 Jun 2015 16:01:21 +0000 (18:01 +0200)]
ipvlan: don't check for valid @mode argument in rtnl_link_ipvlan_set_mode()

In the future kernel might support more modes. Don't be so
strict in rtnl_link_ipvlan_set_mode() and accept any uint16
mode.
This way when adding new modes, rtnl_link_ipvlan_set_mode() does not
need to be changed.

If the user passes an invalid value and sends a message to the kernel,
it will be rejected there.

http://lists.infradead.org/pipermail/libnl/2015-June/001902.html

Fixes: 7de5be85bf9aa3eb9f022e4813226135e89adec2
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoipvlan: fix signature of rtnl_link_ipvlan_get_mode() to signal error
Thomas Haller [Fri, 26 Jun 2015 15:58:06 +0000 (17:58 +0200)]
ipvlan: fix signature of rtnl_link_ipvlan_get_mode() to signal error

http://lists.infradead.org/pipermail/libnl/2015-June/001902.html

Fixes: 7de5be85bf9aa3eb9f022e4813226135e89adec2
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoneigh: merge branch 'neigh-typo'
Thomas Haller [Fri, 26 Jun 2015 15:20:57 +0000 (17:20 +0200)]
neigh: merge branch 'neigh-typo'

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

9 years agoneigh: accept "norarp" in rtnl_neigh_state2str()
Thomas Haller [Fri, 26 Jun 2015 15:07:26 +0000 (17:07 +0200)]
neigh: accept "norarp" in rtnl_neigh_state2str()

Commit 6a9335f101e22cd5eaba4dfcf0a44e2c3097b4ab fixed a typo in the
string-to-flags conversion. At least for rtnl_neigh_str2state()
we want to continue to parse "norarp" for backward compatiblity.

Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoneigh: fix type for NUD_NOARP flag in trans_tbl
Tobias Jungel [Tue, 16 Jun 2015 11:43:07 +0000 (13:43 +0200)]
neigh: fix type for NUD_NOARP flag in trans_tbl

Translate NUD_NOARP to "noarp", instead of "norarp".

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

Fixes: 44d362409d5469aed47d19e7908d19bd194493a4
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoipvlan: merge branch 'add-ipvlan'
Thomas Haller [Fri, 19 Jun 2015 16:04:50 +0000 (18:04 +0200)]
ipvlan: merge branch 'add-ipvlan'

http://lists.infradead.org/pipermail/libnl/2015-June/001902.html

9 years agoipvlan: add a testcase for ipvlan
Cong Wang [Wed, 10 Jun 2015 04:53:10 +0000 (21:53 -0700)]
ipvlan: add a testcase for ipvlan

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agoipvlan: add ipvlan support
Cong Wang [Wed, 10 Jun 2015 04:53:09 +0000 (21:53 -0700)]
ipvlan: add ipvlan support

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agobuild: fix path to cli linker version script for out-of-tree build
jfarrell [Mon, 8 Jun 2015 14:55:06 +0000 (10:55 -0400)]
build: fix path to cli linker version script for out-of-tree build

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

9 years agolib: fix spelling of NL_CAPABILITY_NL_RECV_FAIL_TRUNC_NO_PEEK
Thomas Haller [Fri, 5 Jun 2015 09:28:59 +0000 (11:28 +0200)]
lib: fix spelling of NL_CAPABILITY_NL_RECV_FAIL_TRUNC_NO_PEEK

Instead of NL_CAPABILITY_NL_RECV_FAIL_TRUNK_NO_PEEK.

Fixes: bbdcaea9a779885fedc04817dcc11953a377bfd5
Signed-off-by: Thomas Haller <thaller@redhat.com>
9 years agolib: return error if an incomplete message was read
Thomas Egerer [Thu, 4 Jun 2015 12:43:58 +0000 (14:43 +0200)]
lib: return error if an incomplete message was read

If recvmsg indicates that the message read was truncated libnl retries
to read the complete message after increasing the message buffer. This
only works if the message flags MSG_PEEK | MSG_TRUNC are set. If
NL_MSG_PEEK is not enabled on the nl_sock structure, flags are left
empty and the rest of the truncated message is discarded, hence a
subsequent recvmsg returns the next message (in case of a multipart
message, the NLMSG_DONE) is read and returned.
This patch aborts message processing if the message was truncated and
the NL_MSG_PEEK flags was not activated for the nl_sock structure.

http://lists.infradead.org/pipermail/libnl/2015-June/001888.html

[thaller@redhat.com: add NL_CAPABILITY_NL_RECV_FAIL_TRUNK_NO_PEEK]

Signed-off-by: Thomas Egerer <hakke_007@gmx.de>
Signed-off-by: Thomas Haller <thaller@redhat.com>
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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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

9 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>
9 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>
9 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>
9 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>
9 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>
9 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>