libnl/lib
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
..
cli Support plug qdisc - queue traffic until explicit release 2012-02-14 12:02:04 +01:00
fib_lookup doc: documentation restructuring 2012-05-10 12:03:59 +02:00
genl genl/family flags can be damaged during the auto-indentation. 2012-10-19 22:16:44 +06:00
netfilter cache: provide safe variant of nl_cache_mngt_require() and use it 2012-11-16 01:11:55 +01:00
route route cache: Fix handling of ipv6 multipath routes 2012-12-17 15:16:02 +01:00
.gitignore Added lex.yy.c to .gitignore 2012-08-30 03:19:04 +06:00
addr.c Address comparison bug fixed 2012-08-30 21:00:39 +06:00
attr.c Use NL_DBG() instead of printing warnings and errors to stderr 2012-11-16 00:42:34 +01:00
cache.c cache: only continue iterating over co_groups if it is available 2012-11-26 11:50:56 +01:00
cache_mngr.c Bug Fix: Add new fill socket to cache manager 2012-11-19 10:15:04 +01:00
cache_mngt.c cache: provide safe variant of nl_cache_mngt_require() and use it 2012-11-16 01:11:55 +01:00
data.c Fix types-related warnings based on clang diagnostics 2012-06-13 13:30:26 +02:00
error.c Support for NLM_F_INTR 2011-07-14 10:51:49 +02:00
handlers.c doc: documentation restructuring 2012-05-10 12:03:59 +02:00
hash.c Hash: Properly prefix hash functions 2012-11-10 10:22:26 +01:00
hashtable.c hashtable: remove doc section crashing doxygen 2012-11-11 11:21:10 +01:00
Makefile.am link: basic socket-CAN support 2012-11-29 22:17:58 +01:00
msg.c use safe cache lookup variants internally 2012-11-16 00:29:58 +01:00
nl.c nl: Improve API doc of nl_send_simple() 2012-11-08 21:17:32 +01:00
object.c use safe cache lookup variants internally 2012-11-16 00:29:58 +01:00
socket.c lock abstraction layer 2012-11-15 21:30:57 +01:00
utils.c Use NL_DBG() instead of printing warnings and errors to stderr 2012-11-16 00:42:34 +01:00
version.c Run-time version information is now available 2012-08-30 03:19:04 +06:00