diff options
author | Timo Teräs <timo.teras@iki.fi> | 2008-08-13 17:37:14 +0100 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2008-08-22 19:52:57 +0100 |
commit | 40da22166ff29753a65b7947ed5fa7261fee1d80 (patch) | |
tree | 97b71b8f4ad218b8d136ea93ec9dfd9537408e1b | |
parent | 7f794f2bb079c1a5bb0fdebb815921c168c00e90 (diff) |
[zebra:netlink] Set proto/scope on all route update messages
2008-08-13 Timo Teräs <timo.teras@iki.fi>
* zebra/rt_netlink.c: (netlink_route{,_multipath) Set protocol and
scope appropriately for both NEW and DELROUTE messages, to avoid
wiping out non-zebra routes on delete.
Signed-off-by: Paul Jakma <paul@quagga.net>
-rw-r--r-- | zebra/rt_netlink.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 0bf2d9eb..4234a445 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -1348,6 +1348,8 @@ netlink_route (int cmd, int family, void *dest, int length, void *gate, req.r.rtm_family = family; req.r.rtm_table = table; req.r.rtm_dst_len = length; + req.r.rtm_protocol = RTPROT_ZEBRA; + req.r.rtm_scope = RT_SCOPE_UNIVERSE; if ((zebra_flags & ZEBRA_FLAG_BLACKHOLE) || (zebra_flags & ZEBRA_FLAG_REJECT)) @@ -1357,9 +1359,6 @@ netlink_route (int cmd, int family, void *dest, int length, void *gate, if (cmd == RTM_NEWROUTE) { - req.r.rtm_protocol = RTPROT_ZEBRA; - req.r.rtm_scope = RT_SCOPE_UNIVERSE; - if (discard) { if (zebra_flags & ZEBRA_FLAG_BLACKHOLE) @@ -1424,6 +1423,8 @@ netlink_route_multipath (int cmd, struct prefix *p, struct rib *rib, req.r.rtm_family = family; req.r.rtm_table = rib->table; req.r.rtm_dst_len = p->prefixlen; + req.r.rtm_protocol = RTPROT_ZEBRA; + req.r.rtm_scope = RT_SCOPE_UNIVERSE; if ((rib->flags & ZEBRA_FLAG_BLACKHOLE) || (rib->flags & ZEBRA_FLAG_REJECT)) discard = 1; @@ -1432,9 +1433,6 @@ netlink_route_multipath (int cmd, struct prefix *p, struct rib *rib, if (cmd == RTM_NEWROUTE) { - req.r.rtm_protocol = RTPROT_ZEBRA; - req.r.rtm_scope = RT_SCOPE_UNIVERSE; - if (discard) { if (rib->flags & ZEBRA_FLAG_BLACKHOLE) |