dect
/
libnl
Archived
13
0
Fork 0
Commit Graph

681 Commits

Author SHA1 Message Date
Thomas Graf 6b4a2cb634 3.2.19 release 2013-01-17 14:02:35 +01:00
roopa 310ec86b39 Add ao_compare support to bridge family af_data
This patch adds support for ao_compare operation
to bridge link af data operations.

Adds field ce_mask to struct bridge_data to work
with the ATTR attributes. I can submit separate
patches to introduce mask field to ATTR macros.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-12 11:38:35 +01:00
roopa 09213ee5ee link af ops: Add new ao_compare op to compare link af_data
This patch adds new operation to compare link af_data.
ao_compare is similar to object oo_compare operation.
This op can be used when two links are compared
 for their af data. It takes two link objects in
question, an object specific bitmask defining which
attributes should be compared and flags to control
the behaviour. The function must return a bitmask
with the relevant bit set for each attribute that mismatches.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-12 11:37:32 +01:00
roopa b1ebda9241 cache: Add new nl_cache_find api
This patch adds new cache find api

nl_cache_find api was suggested by Thomas.

Unlike nl_cache_search, this patch uses
nl_object_match_filter() to look for an
object match.

Am not sure this matches what was decided
on the list few weeks back. I will be happy
to make any changes.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-11 13:52:50 +01:00
Flavio Leitner 3540e44b15 link: add carrier support
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-11 13:44:47 +01:00
Thomas Graf f123795434 3.2.18 release 2013-01-08 14:47:03 +01:00
Thomas Graf 383ff943b4 fix include/Makefile.am
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-08 14:44:47 +01:00
Otavio Salvador de5744fb65 build: Fix distribution to include 'nfnetlink_conntrack.h'
The header has not been included in the headers list so it has been
been distributed in the tarball making it fail to build in old kernels.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-08 14:38:49 +01:00
mihai.dontu@gmail.com ba38f39198 cache: make sure the user has specified a callback
In cache_include(), the user callback is used even though one might not
have been specified, leading to a crash. This happens, for example, when
NetworkManager calls nl_cache_include() with the change_cb argument set
to NULL. Fix it by making sure the callback points to a valid address.

Signed-off-by: Mihai Dontu <mihai.dontu@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-06 14:22:15 +01:00
Thomas Graf 00a5879e6e Add <netlink/route/link/can.h> to dist target
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-04 17:44:43 +01:00
Thomas Graf 6369e1fdd9 3.2.17 release 2013-01-04 16:44:52 +01:00
Eric Paris 5d53626100 nlmsg_ok comparison between signed and unsigned
The nlmsg_ok macro has a comparison between an int and a size_t
(unsigned int).  The C spec says the int is cast to unsigned int before
the comparison.  This is a problem as the audit system will send skb's
with skb->len == nlhhdr->nlmsg_len which are NOT aligned.  Thus you can
end up with remaining being negative.  So the comparison becomes

(unsigned int)(-1) >= (unsigned int)16

Which turns out to be true!  It should clearly be false.  So if we cast
the size_t to an int we get a signed comparison and it works.  (This is
what linux/netlink.h and all of the kernel netlink headers do)

Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-04 00:35:18 +01:00
Thomas Jarosch 6971932254 Fix file descriptor leak on error
Detected by cppcheck

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-12-27 13:20:18 +01:00
Thomas Graf de213328f8 cache: Take cache_ops lock when modifying cache ops flags
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-12-27 13:19:04 +01:00
roopa 96bb7c9a4c cache pickup: Avoid duplicates during cache pickup
This patch adds search and replace/update functionality
to cache pickup_cb. This change is required to avoid
duplicates getting into the cache during pickup. Also
helps updating existing objects during cache pickup.
We have seen this in cases of ipv6 equal cost multipath
routes

changes v1 to v2:
	- Updated documentation

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2012-12-21 13:30:21 +01:00
Thomas Graf 91ab1bea5e make: automake provides a cscope target these days
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-12-21 13:30:21 +01:00
roopa 20a051237c Bug Fix: cache_include: Fix object ref release after successful object update
The current code does a rtnl_link_put on new object instead of
old object. This patch fixes it. None of the caches have support
for object update, so this should not have affected anyone yet.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2012-12-17 16:46:58 +01:00
roopa 29b71371e7 route cache: Fix handling of ipv6 multipath routes
There are two ways kernel handles ipv6 equal cost multipath routes
depending on which kernel version you are looking at.

older kernels without ipv6 ECMP support, accept the below ECMP routes,
#ip -6 route add 2001::/16 nexthop via fe80:2::2 dev swp1
#ip -6 route add 2001::/16 nexthop via fe80:2::3 dev swp1

store them as separate routes and pick the last one during lookup.

Newer kernels, after the support for equal cost multipath routes
was added http://patchwork.ozlabs.org/patch/188562/,
now accept multipath routes added individually using the
above 'ip -6 route' format OR
sent using RTA_MULTIPATH with the below command
#ip -6 route add 2001::/16 nexthop via fe80:2::2 dev swp1 nexthop via fe80:2::3 dev swp1

And the kernel now stores and treats them as equal cost multipath routes
during lookups.

However in all cases above, netlink notifications to ipv6 ECMP route adds and deletes
come separately for each next hop.

Example libnl notification in the above case with both old and new kernels:
	inet6 2001::/16 table main type unicast
                scope global priority 0x400 protocol boot
                nexthop via fe80:2::2 dev swp1

        inet6 2001::/16 table main type unicast
                scope global priority 0x400 protocol boot
                nexthop via fe80:2::3 dev swp1

Since they are separate route notifications for objects with same key,
libnl replaces the existing ones and hence only the last route update sticks.

This patch uses the oo_update feature to not replace but update an
existing route if its a ipv6 equal cost multipath route.
The object after an update looks like the below (similar to ipv4 ECMP routes):

        inet6 2001::/16 table main type unicast
                scope global priority 0x400 protocol boot
                nexthop via fe80:2::2 dev swp1
                nexthop via fe80:2::3 dev swp1

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Nolan Leake <nolan@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-12-17 15:16:02 +01:00
Thomas Graf 52b635f1f7 Merge branch 'aligned_be64' of https://github.com/rmfought/libnl 2012-12-17 09:18:47 +01:00
Rich Fought 89e1b30256 Included defs.h so DISABLE_PTHREADS is visible. 2012-12-13 15:56:04 -08:00
Rich Fought 25c407c71f Re-adding #defines for __aligned_be64 for older kernels 2012-12-13 14:23:28 -08:00
Thomas Graf 7c85b8a53b netfilter: update local header files
Needed to NF_CT_EXPECT_PERMANENT etc.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-12-11 18:06:29 +01:00
Thomas Graf 913a689de3 can: provide local copy of <linux/can/netlink.h>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-12-11 17:59:30 +01:00
Gilles Espinasse de14136304 Fix make check when using --disable-cli
Signed-off-by: Gilles Espinasse <g.esp@free.fr>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-12-05 07:55:45 +01:00
Gilles Espinasse 68967eb10e Fix python detection code
Signed-off-by: Gilles Espinasse <g.esp@free.fr>

Compiling libnl versions that include doc or the git tree produce this
checking for python build information...
checking for python2.6... python2.6
checking for main in -lpython2.6... yes
checking python2.6/Python.h usability... yes
checking python2.6/Python.h presence... yes
checking for python2.6/Python.h... yes
./configure: line 4272: test: !=: unary operator expected
checking for python2.5... (cached) python2.6
checking for main in -lpython2.6... (cached) yes
checking for python2.6/Python.h... (cached) yes
./configure: line 4272: test: !=: unary operator expected
checking for python2.4... (cached) python2.6
checking for main in -lpython2.6... (cached) yes
checking for python2.6/Python.h... (cached) yes
./configure: line 4272: test: !=: unary operator expected
checking for python2.3... (cached) python2.6
checking for main in -lpython2.6... (cached) yes
checking for python2.6/Python.h... (cached) yes
./configure: line 4272: test: !=: unary operator expected
checking for python2.2... (cached) python2.6
checking for main in -lpython2.6... (cached) yes
checking for python2.6/Python.h... (cached) yes
./configure: line 4272: test: !=: unary operator expected
checking for python2.1... (cached) python2.6
checking for main in -lpython2.6... (cached) yes
checking for python2.6/Python.h... (cached) yes
./configure: line 4272: test: !=: unary operator expected
checking for python... (cached) python2.6
checking for main in -lpython2.6... (cached) yes
checking for python2.6/Python.h... (cached) yes
./configure: line 4272: test: !=: unary operator expected
  results of the Python check:
    Binary:      python2.6
    Library:     python2.6
    Include Dir: no

Fix the unary operator warning allow to break when one python version is found
Add the more recent python versions
Change send upstream as http://savannah.gnu.org/patch/index.php?7897
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-12-05 07:55:44 +01:00
Benedikt Spranger c86088ff01 link: socket-CAN helper functions
Add helper functions to make socket-CAN configuration easy.

Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-29 22:17:58 +01:00
Benedikt Spranger 5251188673 link: basic socket-CAN support
Controller Area Network (CAN) is a networking technology which has
widespread use in automation, embedded devices and automotive fields.
The socket-CAN package is an implementation of CAN protocols for Linux.

All socket-CAN related configurations are carried out through Netlink.
Add basic socket-CAN support to libnl to be able to configure CAN devices
with libnl.

Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-29 22:17:58 +01:00
Jan Engelhardt ab7f42e0bc build: resolve lex failure
This is an addendum to 0a9d5fcfa4,
which forgot to change ${LEX} to ${FLEX} in lib/Makefile.am.

On openSUSE, /usr/bin/lex is a wrapper that calls `flex -l ...`.
libnl however requires flex, not lex or a compat mode thereof,
so using ${FLEX} is the proper thing to do.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2012-11-27 09:57:42 +01:00
Thomas Graf ffd051fc9a Merge branch 'master' of git://git.inai.de/libnl 2012-11-26 23:34:37 +01:00
Jan Engelhardt 0ba9e99381 build: use foreign mode
This is the magic trick to get rid of files like NEWS, INSTALL,
etc. that are unused in some projects, like libnl.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2012-11-26 21:03:14 +01:00
Jan Engelhardt f3cd3fe950 build: use AC_CONFIG_AUX_DIR
Stash all those scripts into a separate directory and ignore that.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2012-11-26 21:03:14 +01:00
Jan Engelhardt 9d92564566 build: resolve automake-1.12 warnings
/usr/share/automake-1.12/am/ltlibrary.am: warning: 'libnl-cli-3.la':
linking libtool libraries using a non-POSIX archiver requires
'AM_PROG_AR' in 'configure.ac'
(one for each .la file)

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2012-11-26 21:03:13 +01:00
Jan Engelhardt a96a3b6828 build: rename configure.in -> .ac
"configure.in" is a very, very old, obsolete name. Newer automake
will reject it, so rename it now.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2012-11-26 21:03:13 +01:00
Thomas Graf f535de36af 3.2.16 release 2012-11-26 17:43:12 +01:00
Thomas Graf 4149154c22 cache: only continue iterating over co_groups if it is available
A co_groups == NULL must enter the loop to trigger the initial
fill of the cache but may never bump the grp pointer as doing
so prevents the loop from being escaped correctly.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-26 11:50:56 +01:00
Thomas Graf 05a6723eb5 3.2.15 release
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-23 17:06:19 +01:00
Thomas Graf ed3d7066f7 Include the newly added header files in next release
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-23 17:06:15 +01:00
Thomas Graf 3163fa707b cache: reserve room in cache_ops to avoid breaking module ABI too frequently
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-23 16:50:06 +01:00
Thomas Graf 0a9d5fcfa4 configure: Replace broken AM_PROG_LEX with AC_CHECK_PROGS
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-23 16:41:08 +01:00
Richard Marshall a2c4bd8f09 Updated configure.in to make sure bison and lex are installed.
Fixes issue #7
2012-11-19 20:33:26 -08:00
roopa 4d94ed5f6b Bug Fix: Add new fill socket to cache manager
This patch adds a new socket to cache manager to request fill's on.
cache manager today uses cm_sock to request dump from
the kernel. It also listens to netlink async events on the same sock.
The problem with this is that when libnl is waiting to process the
response to get dump request sent to the kernel during fill,
it may receive an async event, resulting in libnl complaining about
unexpected msg

This is usually reproducible when there is heavy netlink async event
traffic during nl_cache_mngr_add.

This patch adds a new cm_sync_sock to use for fill during cache manager
add cache.

The other option is to provide an api to set the cm_sync_sock. But since
this is a bug fix its probably better to fix the cache manager add api
like this patch does. Please suggest otherwise.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Nolan Leake <nolan@cumulusnetworks.com>
Reviewed-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-19 10:15:04 +01:00
Thomas Graf 00132b4696 cache: provide safe variant of nl_cache_mngt_require() and use it
This makes runtime removal of cache operations possible if non-safe
API is not in use by application. The non-safe API will be removed
in the next major version.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-16 01:11:55 +01:00
Thomas Graf 23c4ef67c7 Use NL_DBG() instead of printing warnings and errors to stderr
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-16 00:42:34 +01:00
Thomas Graf 235aa7ff17 cache: hold a reference to the cache ops while a cache is provided over it
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-16 00:29:58 +01:00
Thomas Graf cb82c2a545 use safe cache lookup variants internally
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-16 00:29:58 +01:00
Thomas Graf 2b3912a320 cache: Provide safe versions of nl_cache_ops_associate() and nl_cache_ops_lookup()
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-16 00:19:38 +01:00
Thomas Graf 1a2c3e36a8 cache: Add reference counter to cache operations
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-16 00:17:50 +01:00
Thomas Graf 74926f92dd link: Protect registration of af and link ops with rwlock
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-15 22:33:23 +01:00
Thomas Graf f5af5c5ecd cache: rwlock accesses to cache operations
Puts an rwlock around 'cache_ops'.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-15 21:42:02 +01:00
Thomas Graf 20efa14e5c lock abstraction layer
Hide pthread availability and enablement behind internal API

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-15 21:30:57 +01:00