diff options
author | Timo Teräs <timo.teras@iki.fi> | 2016-01-15 17:36:29 +0200 |
---|---|---|
committer | Paul Jakma <paul.jakma@hpe.com> | 2016-02-26 14:11:46 +0000 |
commit | 0abf6796c3d8ae8f5ea8624668424bc1554de25e (patch) | |
tree | 2d1713deeb970d79930912588341ff756949b49c /zebra/kernel_socket.c | |
parent | b0d02889624eaafa0984873dcd78c086418bdf13 (diff) | |
download | quagga-0abf6796c3d8ae8f5ea8624668424bc1554de25e.tar.bz2 quagga-0abf6796c3d8ae8f5ea8624668424bc1554de25e.tar.xz |
zebra: atomic FIB updates
This commit updates the kernel API so that route changes are
atomically updated using change/replaces messages instead
of first sending a withdraw followed with update.
Same for zclient updates, changes are sent as single ADD
instead of DELETE + ADD.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Diffstat (limited to 'zebra/kernel_socket.c')
-rw-r--r-- | zebra/kernel_socket.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c index 790b1420..ba03498c 100644 --- a/zebra/kernel_socket.c +++ b/zebra/kernel_socket.c @@ -861,7 +861,7 @@ rtm_read (struct rt_msghdr *rtm) return; #endif - if ((rtm->rtm_type == RTM_ADD) && ! (flags & RTF_UP)) + if ((rtm->rtm_type == RTM_ADD || rtm->rtm_type == RTM_CHANGE) && ! (flags & RTF_UP)) return; /* This is connected route. */ @@ -1072,14 +1072,14 @@ rtm_write (int message, ifp = if_lookup_by_index (index); - if (gate && message == RTM_ADD) + if (gate && (message == RTM_ADD || message == RTM_CHANGE)) msg.rtm.rtm_flags |= RTF_GATEWAY; /* When RTF_CLONING is unavailable on BSD, should we set some * other flag instead? */ #ifdef RTF_CLONING - if (! gate && message == RTM_ADD && ifp && + if (! gate && (message == RTM_ADD || message == RTM_CHANGE) && ifp && (ifp->flags & IFF_POINTOPOINT) == 0) msg.rtm.rtm_flags |= RTF_CLONING; #endif /* RTF_CLONING */ @@ -1104,7 +1104,7 @@ rtm_write (int message, if (mask) msg.rtm.rtm_addrs |= RTA_NETMASK; - else if (message == RTM_ADD) + else if (message == RTM_ADD || message == RTM_CHANGE) msg.rtm.rtm_flags |= RTF_HOST; /* Tagging route with flags */ |