No description
Find a file
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
doc Fix python detection code 2012-12-05 07:55:44 +01:00
etc pktloc: support to specify a shift operator for packet locations 2010-11-04 20:01:36 +01:00
include Merge branch 'aligned_be64' of https://github.com/rmfought/libnl 2012-12-17 09:18:47 +01:00
lib route cache: Fix handling of ipv6 multipath routes 2012-12-17 15:16:02 +01:00
m4 doc: Check documentation generation requirements with autoconf 2012-05-09 10:06:24 +02:00
man genl: Update genl-ctrl-list(8) 2012-06-01 13:10:03 +02:00
python Enabled the use of Links as context managers. 2012-10-04 16:36:55 -04:00
src cache: provide safe variant of nl_cache_mngt_require() and use it 2012-11-16 01:11:55 +01:00
tests Fix make check when using --disable-cli 2012-12-05 07:55:45 +01:00
.gitignore build: use AC_CONFIG_AUX_DIR 2012-11-26 21:03:14 +01:00
autogen.sh doc: Split doc/ into separate packages 2012-10-19 16:16:06 +02:00
ChangeLog libnl 3.2.10 2012-06-06 11:43:53 +02:00
configure.ac Merge branch 'master' of git://git.inai.de/libnl 2012-11-26 23:34:37 +01:00
COPYING Update COPYING to fix FSF address 2012-01-17 12:38:37 +01:00
libnl-3.0.pc.in Switch to libtool versioning system 2011-09-13 22:58:08 +02:00
libnl-cli-3.0.pc.in Add libnl-cli-3.0 to pkg-config tool 2011-10-10 11:39:24 +02:00
libnl-genl-3.0.pc.in Switch to libtool versioning system 2011-09-13 22:58:08 +02:00
libnl-nf-3.0.pc.in Switch to libtool versioning system 2011-09-13 22:58:08 +02:00
libnl-route-3.0.pc.in Switch to libtool versioning system 2011-09-13 22:58:08 +02:00
Makefile.am Don't include doc/ in toplevel dist 2012-10-22 12:09:03 +02:00