]> granicus.if.org Git - libnl/log
libnl
10 years agodocs: add code comment to explain the meaning of the fields in rtnl_addr_cacheinfo
Thomas Haller [Thu, 3 Apr 2014 15:47:37 +0000 (17:47 +0200)]
docs: add code comment to explain the meaning of the fields in rtnl_addr_cacheinfo

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agogitignore: ignore 'nf-ct-add' (netfilter/ct)
Thomas Haller [Wed, 30 Apr 2014 11:06:50 +0000 (13:06 +0200)]
gitignore: ignore 'nf-ct-add' (netfilter/ct)

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoact: grab a reference when adding an action to a filter
Cong Wang [Thu, 24 Apr 2014 00:28:29 +0000 (17:28 -0700)]
act: grab a reference when adding an action to a filter

When we add an action to a filter, its lifetime becomes
same with the filter. So in case user frees it before
us, we could just grab a reference here.

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 agoveth: grab a reference for rtnl_link_veth_get_peer()
Cong Wang [Tue, 29 Apr 2014 17:38:30 +0000 (10:38 -0700)]
veth: grab a reference for rtnl_link_veth_get_peer()

So that users could keep a refcount for the peer.
The capability trick is from Thomas Haller.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agogitignore: ignore patch files
Hangbin Liu [Wed, 16 Apr 2014 02:16:36 +0000 (10:16 +0800)]
gitignore: ignore patch files

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agodoc/core: reply message should send from kernel to app
Hangbin Liu [Wed, 16 Apr 2014 02:16:35 +0000 (10:16 +0800)]
doc/core: reply message should send from kernel to app

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agogitignore: ignore ctags file
Hangbin Liu [Wed, 16 Apr 2014 02:16:34 +0000 (10:16 +0800)]
gitignore: ignore ctags file

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
[thaller@redhat.com: change to ignore /tags only on top-level]
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agonetfilter/ct: expand CT parameters that can be used in add/delete operations
Rich Fought [Thu, 27 Feb 2014 00:02:13 +0000 (16:02 -0800)]
netfilter/ct: expand CT parameters that can be used in add/delete operations

This expands functionality for manipulating conntracks over netlink by
adding other attributes to nfnl_ct_build_message(). Added a command link
program to add conntracks.

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

[thaller@redhat.com: cleaned up whitespace from original patch]
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agopython: fix wrongly passing argument to function in ObjIterator.next()
Hiroaki KAWAI [Wed, 9 Apr 2014 01:09:16 +0000 (10:09 +0900)]
python: fix wrongly passing argument to function in ObjIterator.next()

self.__next__() bound method does not take an extra argument.

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

Signed-off-by: Hiroaki KAWAI <kawai@stratosphere.co.jp>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoadd NLM_F_EXCL to rtnl_link_veth_add()
Cong Wang [Wed, 2 Apr 2014 01:03:33 +0000 (18:03 -0700)]
add NLM_F_EXCL to rtnl_link_veth_add()

rtnl_link_veth_add() is a helper API we provide, it makes sense to
set NLM_F_EXCL for it since it doesn't accept flags as a parameter.

BTW, correct an indention too.

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 agoveth: use nl_object_clone() to deep copy rtnl_link object
Cong Wang [Wed, 2 Apr 2014 01:03:32 +0000 (18:03 -0700)]
veth: use nl_object_clone() to deep copy rtnl_link object

Currently we use memcpy() to copy the peer rtnl_link for veth device,
this is wrong, we should do deep copy by calling nl_object_clone()
recursively. We should be careful and need to make sure we only call
it once.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoveth: implement ->io_free
Cong Wang [Wed, 2 Apr 2014 01:03:31 +0000 (18:03 -0700)]
veth: implement ->io_free

So that veth link can be just put by rtnl_link_put()

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 agoveth: implement ->io_alloc
Cong Wang [Wed, 2 Apr 2014 01:03:30 +0000 (18:03 -0700)]
veth: implement ->io_alloc

Users don't have to call rtnl_link_veth_alloc(), instead
use generic rtnl_link_set_type().

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 agolink: call rtnl_link_set_type() in link_msg_parser()
Cong Wang [Wed, 2 Apr 2014 01:03:29 +0000 (18:03 -0700)]
link: call rtnl_link_set_type() in link_msg_parser()

We need to call link-specific ->io_alloc() to alloc
addtional structures.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoact: fix policy range check
Cong Wang [Sat, 5 Apr 2014 01:15:16 +0000 (18:15 -0700)]
act: fix policy range check

mirred action should accept all TC_ACT* policy

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 agoroute/addr: only sent IFA_FLAGS when needed to workaround picky older kernels
Thomas Haller [Thu, 3 Apr 2014 16:09:51 +0000 (18:09 +0200)]
route/addr: only sent IFA_FLAGS when needed to workaround picky older kernels

Older kernels don't accept receiving unknown netlink attributes.
See net/core/rtnetlink.c, rtnetlink_rcv_msg(). This was fixed by kernel
commit 661d2967b3f1b34eeaa7e212e7b9bbe8ee072b59.

As a workaround, only set the additional attributes, when the user
provided flags that makes this necessary and useful.

https://github.com/thom311/libnl/issues/56
https://bugzilla.redhat.com/show_bug.cgi?id=1063885

Based-on-patch-by: Pavel Kankovsky <peak@argo.troja.mff.cuni.cz>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agolink: Catch missing io_free() implementations
Thomas Graf [Mon, 31 Mar 2014 11:21:06 +0000 (13:21 +0200)]
link: Catch missing io_free() implementations

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute: fix off-by-one in rtnl_act_parse()
Cong Wang [Thu, 27 Mar 2014 05:43:16 +0000 (22:43 -0700)]
route: fix off-by-one in rtnl_act_parse()

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 agoroute: update copy of kernel header 'ip.h'
Thomas Haller [Thu, 20 Mar 2014 18:18:46 +0000 (19:18 +0100)]
route: update copy of kernel header 'ip.h'

Take 'include/uapi/linux/ip.h' from current kernel v3.13
(commit d8ec26d7f8287f5788a494f56e8814210f0e64be).

Also add three new IPV4_DEVCONF_* names.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute: rename internal copy of kernel header file 'inetdevice.h' to 'ip.h'
Thomas Haller [Thu, 20 Mar 2014 18:18:45 +0000 (19:18 +0100)]
route: rename internal copy of kernel header file 'inetdevice.h' to 'ip.h'

libnl used 'inetdevice.h' for the IPV4_DEVCONF_* names, which the kernel
in the meantime moved to public user space API and are now defined in 'ip.h'.

As a first step, rename the file 'inetdevice.h'.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute: update kernel header snmp.h and fix inet6_parse_protinfo() after kernel API...
Thomas Haller [Thu, 20 Mar 2014 18:18:44 +0000 (19:18 +0100)]
route: update kernel header snmp.h and fix inet6_parse_protinfo() after kernel API breakage

Take 'include/uapi/linux/snmp.h' from current kernel v3.13
(commit d8ec26d7f8287f5788a494f56e8814210f0e64be).

The header file added new values for IPSTATS_MIB_* and ICMP6_MIB_*, but
more importantly, the kernel broke user space API by reordering enum values in
IPSTATS_MIB_*. Add a workaround when parsing IFLA_PROTINFO trying to
be compatible with both older and newer kernels.

Note that this workaround might fail for some specific kernel versions by
assuming the old enum value mapping, although the kernel version already
contains the API change. In this case rtnl_link_get_stat() mixes up
values.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute: detect missing cfgid in rtnl_link_inet_get_conf()
Thomas Haller [Thu, 20 Mar 2014 18:18:43 +0000 (19:18 +0100)]
route: detect missing cfgid in rtnl_link_inet_get_conf()

If the netlink message for IFLA_INET_CONF contains less then
IPV4_DEVCONF_MAX entires, the last entries in i_conf are unset.
Modify rtnl_link_inet_get_conf() to return -EINVAL when accessing
an unset cfgid.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute: don't enforce minlen in inet6_parse_protinfo() (IFLA_PROTINFO) and inet_parse_...
Thomas Haller [Thu, 20 Mar 2014 18:18:42 +0000 (19:18 +0100)]
route: don't enforce minlen in inet6_parse_protinfo() (IFLA_PROTINFO) and inet_parse_af() (IFLA_AF_SPEC)

Older kernel version might have fewer values defined, so they would send
netlink messages that got rejected. Only check that at least one value
got sent.

This is especially grave as libnl uses an internal copy of the
kernel header files. Thus not only it is bound to the installed kernel
headers but to the libnl internal header copies that might easily be out
of sync with the kernel.

This affects IFLA_PROTINFO, inet6_parse_protinfo():
  - tb[IFLA_INET6_CONF], expecting DEVCONF_MAX
  - tb[IFLA_INET6_STATS], expecting __IPSTATS_MIB_MAX
  - tb[IFLA_INET6_ICMP6STATS], expecting __ICMP6_MIB_MAX
and IFLA_AF_SPEC, inet_parse_af():
  - tb[IFLA_INET_CONF], expecting IPV4_DEVCONF_MAX

https://bugzilla.redhat.com/show_bug.cgi?id=1062533

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agou32: add const to rtnl_u32_add_key_in*_addr()
Cong Wang [Thu, 20 Mar 2014 17:24:12 +0000 (10:24 -0700)]
u32: add const to rtnl_u32_add_key_in*_addr()

Cc: Thomas Haller <thaller@redhat.com>
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 agolink: document sk == NULL case for rtnl_link_alloc_cache()
Cong Wang [Thu, 20 Mar 2014 17:45:45 +0000 (10:45 -0700)]
link: document sk == NULL case for rtnl_link_alloc_cache()

When sk == NULL, rtnl_link_alloc_cache() returns 0 but the cache
is still empty. We should document this behavior, otherwise it is confusing.

Cc: Thomas Haller <thaller@redhat.com>
Cc: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoutils: indicate capability NL_CAPABILITY_ROUTE_BUILD_MSG_SET_SCOPE
Thomas Haller [Thu, 13 Mar 2014 12:16:51 +0000 (13:16 +0100)]
utils: indicate capability NL_CAPABILITY_ROUTE_BUILD_MSG_SET_SCOPE

This capability indicates that libnl does no longer overwrites
the route scope in rtnl_route_build_msg(), as fixed by commit
85ec9c7ad80c60f4f619472f2bb9d9595da93b26.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoutils: add nl_has_capability() function
Thomas Haller [Thu, 13 Mar 2014 12:16:05 +0000 (13:16 +0100)]
utils: add nl_has_capability() function

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agofill prio and protocol attr bits when parsing cls message
Cong Wang [Wed, 12 Mar 2014 23:42:39 +0000 (16:42 -0700)]
fill prio and protocol attr bits when parsing cls message

Otherwise, the filter we get from a cls cache can't be used
for removal.

Cc: Thomas Haller <thaller@redhat.com>
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 agoremove some useless code in lib/route/cls/u32.c
Cong Wang [Wed, 26 Feb 2014 21:35:13 +0000 (13:35 -0800)]
remove some useless code in lib/route/cls/u32.c

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 agofix comments for rtnl_act_add()
Cong Wang [Wed, 26 Feb 2014 21:35:12 +0000 (13:35 -0800)]
fix comments for rtnl_act_add()

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 agobasic: make BASIC_ATTR_TARGET optional
Cong Wang [Wed, 26 Feb 2014 21:35:11 +0000 (13:35 -0800)]
basic: make BASIC_ATTR_TARGET optional

At least in kernel TCA_BASIC_CLASSID is optional.

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 agoroute: rtnl_route_build_msg() should not overwrite the route scope
Thomas Haller [Thu, 13 Feb 2014 20:31:37 +0000 (21:31 +0100)]
route: rtnl_route_build_msg() should not overwrite the route scope

rtnl_route_build_msg() should allow the user to set the route scope
explicitly to RT_SCOPE_NOWHERE.

This is useful for IPv4 routes, because when deleting a route,
the kernel requires the scope to match, unless the scope is set to
RT_SCOPE_NOWHERE. Thus by setting the scope to RT_SCOPE_NOWHERE,
the user can delete a route, even without knowing its scope.

rtnl_route_build_msg() should only try to guess the scope, if it was
not explicitly specified.

Signed-off-by: Thomas Haller <thaller@redhat.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
10 years agoutils: fix nl_msec2str() which always returned '0msec' for whole second durations
Thomas Haller [Wed, 19 Feb 2014 18:22:13 +0000 (19:22 +0100)]
utils: fix nl_msec2str() which always returned '0msec' for whole second durations

If the duration was without subsecond part, the function always returned
'0msec', instead of giving the time in days, hours, minutes or seconds.

Regression introduced by commit b3fb89f445108677d405c62865b25aeea209d10a.

Signed-off-by: Thomas Haller <thaller@redhat.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
10 years agoremove nl_cache_lookup() from cache.h
Cong Wang [Wed, 29 Jan 2014 23:45:03 +0000 (15:45 -0800)]
remove nl_cache_lookup() from cache.h

It is never defined.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoremove the obsolete src/cls directory
Cong Wang [Wed, 29 Jan 2014 23:45:02 +0000 (15:45 -0800)]
remove the obsolete src/cls directory

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute: fix return value of nl_rtgen_request()
Thomas Haller [Fri, 31 Jan 2014 13:15:13 +0000 (14:15 +0100)]
route: fix return value of nl_rtgen_request()

According to documentation, nl_rtgen_request() returns 0 on success,
but before it returned the number of bytes sent.

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agobuild: fix error when running `configure --disable-doc`
Thomas Haller [Wed, 29 Jan 2014 17:13:35 +0000 (18:13 +0100)]
build: fix error when running `configure --disable-doc`

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agolibnl-3.2.24 release libnl3_2_24
Thomas Haller [Tue, 21 Jan 2014 18:47:27 +0000 (19:47 +0100)]
libnl-3.2.24 release

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agodoc: fix typo in documentation
Thomas Haller [Wed, 8 Jan 2014 16:23:05 +0000 (17:23 +0100)]
doc: fix typo in documentation

Also fix typo in source code comment.

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agopython: fix build error for missing library_path in setup.py
Thomas Haller [Tue, 21 Jan 2014 18:05:37 +0000 (19:05 +0100)]
python: fix build error for missing library_path in setup.py

Patch obtained from gentoo package.

https://bugs.gentoo.org/show_bug.cgi?id=477110
https://bugs.gentoo.org/show_bug.cgi?id=490584

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoaddr: add address flag IFA_F_NOPREFIXROUTE
Thomas Haller [Wed, 8 Jan 2014 00:44:58 +0000 (01:44 +0100)]
addr: add address flag IFA_F_NOPREFIXROUTE

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoact: remove rtnl_act_alloc_cache()
Cong Wang [Wed, 15 Jan 2014 01:37:42 +0000 (17:37 -0800)]
act: remove rtnl_act_alloc_cache()

It is complicated to cache tc actions, they are different
from tc qdisc's and filters by design. So, it is simple
if we just don't cache them.

This patch only removes the tc action cache allocation API.
We still need to bypass the libnl cache layer from scratch,
but that would not break ABI any more, therefore we can do
it later.

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 agobridge: add rtnl_link_add_bridge() function
HongweiBi [Thu, 2 Jan 2014 03:29:42 +0000 (11:29 +0800)]
bridge: add rtnl_link_add_bridge() function

Signed-off-by: HongweiBi <hwbi2008@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoaddr: add address flag IFA_F_MANAGETEMPADDR
Thomas Haller [Thu, 2 Jan 2014 09:51:38 +0000 (10:51 +0100)]
addr: add address flag IFA_F_MANAGETEMPADDR

Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoadd support for IFA_FLAGS nl attribute
Jiri Pirko [Sun, 8 Dec 2013 11:26:24 +0000 (12:26 +0100)]
add support for IFA_FLAGS nl attribute

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Thomas Haller <thaller@redhat.com>
10 years agoroute: add libnl name prefix to global variable link_policy
Thomas Haller [Thu, 2 Jan 2014 10:00:31 +0000 (11:00 +0100)]
route: add libnl name prefix to global variable link_policy

Public names should be prefixed with a libnl specific
prefix to avoid name collisions. Rename link_policy to
rtln_link_policy.

Related bugs:
  https://github.com/thom311/libnl/issues/52
  https://bugzilla.gnome.org/show_bug.cgi?id=720902
  https://bugs.gentoo.org/show_bug.cgi?id=494986
  https://bugs.gentoo.org/show_bug.cgi?id=494890

Signed-off-by: Thomas Haller <thaller@redhat.com>
11 years agolibnl-3.2.24-rc1 release libnl3_2_24rc1
Thomas Haller [Mon, 16 Dec 2013 19:57:57 +0000 (20:57 +0100)]
libnl-3.2.24-rc1 release

Signed-off-by: Thomas Haller <thaller@redhat.com>
11 years agobuild: fix build failure when using different build dir (make distcheck)
Thomas Haller [Mon, 16 Dec 2013 20:19:14 +0000 (21:19 +0100)]
build: fix build failure when using different build dir (make distcheck)

`make distcheck` builds outside the source directory using
`../configure --srcdir=..`. This was broken because libnl.sym was
expected in the $(top_srcdir) instead of $(top_builddir).

Signed-off-by: Thomas Haller <thaller@redhat.com>
11 years agou32: add rtnl_u32_get_key()
Cong Wang [Fri, 13 Dec 2013 23:24:50 +0000 (15:24 -0800)]
u32: add rtnl_u32_get_key()

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
11 years agocache: Add missing declaration for nl_cache_find()
Thomas Graf [Fri, 13 Dec 2013 14:57:43 +0000 (15:57 +0100)]
cache: Add missing declaration for nl_cache_find()

Reported-by: Andrej.Gantvorg@wago.com
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoadd declaration for rtnl_basic_add_action()
Cong Wang [Wed, 4 Dec 2013 04:16:10 +0000 (20:16 -0800)]
add declaration for rtnl_basic_add_action()

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoRevert "basic: Add missing declaration for rtnl_basic_add_action()"
Thomas Graf [Wed, 11 Dec 2013 08:10:32 +0000 (09:10 +0100)]
Revert "basic: Add missing declaration for rtnl_basic_add_action()"

This reverts commit 4b84836085067722882129b8c6a864364ae4ca42.

11 years agoRevert "basic: Declare rtnl_act in basic.h to silence warning"
Thomas Graf [Wed, 11 Dec 2013 08:10:26 +0000 (09:10 +0100)]
Revert "basic: Declare rtnl_act in basic.h to silence warning"

This reverts commit a858d996e952af5bf449b87775f74355d492a0ec.

11 years agoadd an assertion in rtnl_tc_set_link()
Cong Wang [Wed, 4 Dec 2013 04:16:11 +0000 (20:16 -0800)]
add an assertion in rtnl_tc_set_link()

So that we can catch the bug easily.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agobasic: Declare rtnl_act in basic.h to silence warning
Thomas Graf [Mon, 9 Dec 2013 14:43:33 +0000 (15:43 +0100)]
basic: Declare rtnl_act in basic.h to silence warning

Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agofix some typo in lib/route/act.c
Cong Wang [Fri, 6 Dec 2013 22:58:38 +0000 (14:58 -0800)]
fix some typo in lib/route/act.c

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agobasic: Add missing declaration for rtnl_basic_add_action()
Thomas Graf [Mon, 9 Dec 2013 14:39:11 +0000 (15:39 +0100)]
basic: Add missing declaration for rtnl_basic_add_action()

Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agobasic: add action removal API
Cong Wang [Thu, 5 Dec 2013 23:48:30 +0000 (15:48 -0800)]
basic: add action removal API

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agou32: add action removal API
Cong Wang [Thu, 5 Dec 2013 23:48:29 +0000 (15:48 -0800)]
u32: add action removal API

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoadd rtnl_mirred_get* functions
Cong Wang [Thu, 5 Dec 2013 23:48:28 +0000 (15:48 -0800)]
add rtnl_mirred_get* functions

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agorename rtnl_mirred_set_index() to rtnl_mirred_set_ifindex()
Cong Wang [Thu, 5 Dec 2013 23:48:27 +0000 (15:48 -0800)]
rename rtnl_mirred_set_index() to rtnl_mirred_set_ifindex()

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agofix a bug in rtnl_act_fill()
Cong Wang [Thu, 5 Dec 2013 23:48:26 +0000 (15:48 -0800)]
fix a bug in rtnl_act_fill()

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoadd declaration for rtnl_cls_change()
Cong Wang [Thu, 5 Dec 2013 23:48:25 +0000 (15:48 -0800)]
add declaration for rtnl_cls_change()

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoadd a parameter to rtnl_link_veth_add()
Cong Wang [Wed, 4 Dec 2013 04:16:08 +0000 (20:16 -0800)]
add a parameter to rtnl_link_veth_add()

Usually the peer of a veth device is moved to a new netns
after creation, so add a pid parameter to rtnl_link_veth_add().

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agofix rtnl_link_info_parse() and rtnl_link_fill_info()
Cong Wang [Wed, 4 Dec 2013 04:16:09 +0000 (20:16 -0800)]
fix rtnl_link_info_parse() and rtnl_link_fill_info()

So that the veth peer could be parsed correctly.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoThe commit 6a8d90f5fec4 "attr: Allow attribute type 0" intended to
Samuel Gauthier [Fri, 29 Nov 2013 08:28:44 +0000 (09:28 +0100)]
The commit 6a8d90f5fec4 "attr: Allow attribute type 0" intended to
allow the parsing of {netlink,packet,unix}_diag, even if they are
using type 0 for valid attributes.

It lacked this part in nla_parse.

Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Samuel Gauthier <samuel.gauthier@6wind.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoattr: Allow attribute type 0
Thomas Graf [Thu, 28 Nov 2013 22:14:38 +0000 (23:14 +0100)]
attr: Allow attribute type 0

{netlink,packet,unix}_diag use attribute type 0 for valid
attributes. The value was reserved and usage was prohibited
by the protocol but we can't undo the breakge.

Make libnl accept attribute type 0 to allow parsing these
attributes.

Reported-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agobuild: separate compiler and linker flags
Jan Engelhardt [Tue, 26 Nov 2013 14:19:45 +0000 (15:19 +0100)]
build: separate compiler and linker flags

-Wall is a compiler flag, and thus should be in CFLAGS,
not CPPFLAGS. Similarly, -l belongs into LDADD/LIBADD because of
ordering constraints.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoadd fq_codel cli module
Cong Wang [Wed, 20 Nov 2013 05:10:05 +0000 (21:10 -0800)]
add fq_codel cli module

Cc: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoadd fq_codel qdisc
Cong Wang [Wed, 20 Nov 2013 05:10:04 +0000 (21:10 -0800)]
add fq_codel qdisc

Cc: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agofix linux/pkt_act.h inclusion
Cong Wang [Mon, 11 Nov 2013 23:17:49 +0000 (15:17 -0800)]
fix linux/pkt_act.h inclusion

We should copy and use the kernel header linux/tc_act/tc_mirred.h.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agolink: Fall back to global provisioned link cache if object is not a cache resident
Thomas Graf [Sat, 9 Nov 2013 09:04:35 +0000 (10:04 +0100)]
link: Fall back to global provisioned link cache if object is not a cache resident

... if that fails, print ifindices directly.

Reported-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoadd veth.h into include/Makefile.am
Cong Wang [Sat, 9 Nov 2013 00:07:12 +0000 (16:07 -0800)]
add veth.h into include/Makefile.am

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agobasic: add action support
Cong Wang [Fri, 8 Nov 2013 18:47:53 +0000 (10:47 -0800)]
basic: add action support

Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoadd u32 action test
Cong Wang [Fri, 8 Nov 2013 18:47:52 +0000 (10:47 -0800)]
add u32 action test

Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoadd u32 action support
Cong Wang [Fri, 8 Nov 2013 18:47:51 +0000 (10:47 -0800)]
add u32 action support

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoadd mirred tc action
Cong Wang [Fri, 8 Nov 2013 18:47:50 +0000 (10:47 -0800)]
add mirred tc action

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoadd initial tc action support
Cong Wang [Fri, 8 Nov 2013 18:47:49 +0000 (10:47 -0800)]
add initial tc action support

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agodo not compile some address families when not available
Cong Wang [Fri, 8 Nov 2013 19:32:13 +0000 (11:32 -0800)]
do not compile some address families when not available

This fixes the following error while compiling libnl3 on CentOS5:

addr.c:1027: error: 'AF_RDS' undeclared here (not in a function)
addr.c:1033: error: 'AF_CAN' undeclared here (not in a function)
addr.c:1034: error: 'AF_TIPC' undeclared here (not in a function)
addr.c:1036: error: 'AF_IUCV' undeclared here (not in a function)
addr.c:1037: error: 'AF_RXRPC' undeclared here (not in a function)
addr.c:1038: error: 'AF_ISDN' undeclared here (not in a function)
addr.c:1039: error: 'AF_PHONET' undeclared here (not in a function)
make[2]: *** [addr.lo] Error 1

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoMerge pull request #50 from olafhering/olh_memset__nlmsg_alloc
Thomas Graf [Fri, 8 Nov 2013 23:47:06 +0000 (15:47 -0800)]
Merge pull request #50 from olafhering/olh_memset__nlmsg_alloc

Remove extra memset from __nlmsg_alloc

11 years agoRemove extra memset from __nlmsg_alloc
Olaf Hering [Fri, 8 Nov 2013 16:15:16 +0000 (17:15 +0100)]
Remove extra memset from __nlmsg_alloc

A few lines above nm->nm_nlh is already allocated with calloc, the
allocated memory has at least sizeof(struct nlmsghdr).

Signed-off-by: Olaf Hering <olaf@aepfle.de>
11 years agopython: Include all files in distribution
Thomas Graf [Wed, 6 Nov 2013 09:28:37 +0000 (10:28 +0100)]
python: Include all files in distribution

Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agofactor out rtnl_link_info_parse()
Cong Wang [Fri, 1 Nov 2013 23:58:47 +0000 (16:58 -0700)]
factor out rtnl_link_info_parse()

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoadd link netns support
Cong Wang [Fri, 1 Nov 2013 23:58:49 +0000 (16:58 -0700)]
add link netns support

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoadd veth link support
Cong Wang [Fri, 1 Nov 2013 23:58:48 +0000 (16:58 -0700)]
add veth link support

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agofactor out rtnl_link_fill_info()
Cong Wang [Fri, 1 Nov 2013 23:58:46 +0000 (16:58 -0700)]
factor out rtnl_link_fill_info()

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoadd ingress qdisc
Cong Wang [Fri, 25 Oct 2013 06:59:15 +0000 (23:59 -0700)]
add ingress qdisc

This patch adds ingress qdisc to libnl.

Cc: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years ago3.2.23 release libnl3_2_23
Thomas Graf [Wed, 30 Oct 2013 23:11:18 +0000 (00:11 +0100)]
3.2.23 release

11 years agotests: fix make test-create-vxlan
Cong Wang [Fri, 25 Oct 2013 07:02:05 +0000 (00:02 -0700)]
tests: fix make test-create-vxlan

Cc: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agolibnl-3.2.23-rc2 release libnl3_2_23rc2
Thomas Graf [Wed, 23 Oct 2013 09:06:50 +0000 (11:06 +0200)]
libnl-3.2.23-rc2 release

Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoinclude: Provide <netlink/route/link/vxlan.h> in distribution
Thomas Graf [Wed, 23 Oct 2013 07:28:05 +0000 (09:28 +0200)]
include: Provide <netlink/route/link/vxlan.h> in distribution

Reported-by: Jeroen Roovers <jer@gentoo.org>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoFix up -rc1 versioning to not be included in libnl_micro_version
Thomas Graf [Tue, 22 Oct 2013 14:45:21 +0000 (16:45 +0200)]
Fix up -rc1 versioning to not be included in libnl_micro_version

Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agodoc: Add instructions on how to build docs
Thomas Graf [Tue, 22 Oct 2013 14:33:27 +0000 (16:33 +0200)]
doc: Add instructions on how to build docs

Reported-by: Teto <mattator@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agodoxygen-link: Be python3 compatible
Thomas Graf [Tue, 22 Oct 2013 14:32:23 +0000 (16:32 +0200)]
doxygen-link: Be python3 compatible

Reported-by: Teto <mattator@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agolibnl-3.2.23-rc1 release libnl3_2_23rc1
Thomas Graf [Tue, 22 Oct 2013 13:26:12 +0000 (15:26 +0200)]
libnl-3.2.23-rc1 release

11 years agortnl-addr: set ifa_flags when creating/updating address
Thomas Haller [Tue, 22 Oct 2013 08:38:14 +0000 (10:38 +0200)]
rtnl-addr: set ifa_flags when creating/updating address

Set the address flags when creating/updating an address with
rtnl_addr_add/rtnl_addr_build_add_request. Before, the flags
were not passed on.

As of now, the flags except IFA_F_NODAD|IFA_F_HOMEADDRESS are ignored by
the kernel. Still pass them on without filtering.

Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agoobj: Check for NULL pointer in nl_object_clone()
Thomas Graf [Tue, 22 Oct 2013 12:16:43 +0000 (14:16 +0200)]
obj: Check for NULL pointer in nl_object_clone()

Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agopython: add bridge flags API
Nicolas PLANEL [Fri, 11 Oct 2013 15:52:22 +0000 (15:52 +0000)]
python: add bridge flags API

Add flags set/get methods aim to change bridge flags :
 o hairpin_mode
 o bpdu_guard
 o root_block
 o fast_leave

Signed-off-by: Nicolas PLANEL <nicolas.planel@enovance.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agotest: add python bridge testing sample
Nicolas PLANEL [Thu, 10 Oct 2013 22:34:18 +0000 (22:34 +0000)]
test: add python bridge testing sample

New test sample file, test-create-bridge.py
Create an bridge (testbrige) and attach an already setup interface (testtap1) to it.

Signed-off-by: Nicolas PLANEL <nicolas.planel@enovance.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
11 years agopython: add basic netlink protocol bridge interface support
Nicolas PLANEL [Thu, 10 Oct 2013 22:27:44 +0000 (22:27 +0000)]
python: add basic netlink protocol bridge interface support

Implements basic bridge interface support using netlink protocol

Signed-off-by: Nicolas PLANEL <nicolas.planel@enovance.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>