]> git.proxmox.com Git - mirror_frr.git/commitdiff
[zebra:netlink] Set proto/scope on all route update messages
authorTimo Teräs <timo.teras@iki.fi>
Wed, 13 Aug 2008 16:37:14 +0000 (17:37 +0100)
committerPaul Jakma <paul@quagga.net>
Fri, 22 Aug 2008 18:52:57 +0000 (19:52 +0100)
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>
zebra/rt_netlink.c

index 0bf2d9ebb0f04027f90c119e3ddc161d7c813d35..4234a4455f528878bcc2c9681e99193fafa93421 100644 (file)
@@ -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)