]> git.puffer.fish Git - matthieu/frr.git/commitdiff
quagga: delete interface from default table when moved to vrf
authorDon Slice <dslice@cumulusnetworks.com>
Fri, 18 Mar 2016 19:53:15 +0000 (19:53 +0000)
committerDon Slice <dslice@cumulusnetworks.com>
Fri, 18 Mar 2016 19:53:15 +0000 (19:53 +0000)
All daemons changed to flag an interface that has been moved to a vrf as DELETED instead of INTERNAL.
When they were flagged as IFINDEX_INTERNAL, ospf, rip, and isis would re-install them in the default
assuming that they were being "pre-defined" before the kernel definitions.

Ticket: CM-9265
Signed-off-by: Don Slice
Reviewed-by: Donald Sharp
bgpd/bgp_zebra.c
isisd/isis_circuit.c
isisd/isis_zebra.c
lib/if.h
ospf6d/ospf6_zebra.c
ospfd/ospf_vty.c
ospfd/ospf_zebra.c
ripd/rip_interface.c
ripngd/ripng_interface.c

index a00cc9f67eb78523b2c63770eb82abcd0a141b10..878c755f8ca78a961b18fa3f71cd2898d063ee8c 100644 (file)
@@ -319,7 +319,7 @@ bgp_interface_delete (int command, struct zclient *zclient,
   if (! ifp) /* This may happen if we've just unregistered for a VRF. */
     return 0;
 
-  ifp->ifindex = IFINDEX_INTERNAL;
+  ifp->ifindex = IFINDEX_DELETED;
 
   if (BGP_DEBUG (zebra, ZEBRA))
     zlog_debug("Rx Intf del VRF %u IF %s", vrf_id, ifp->name);
index ca8f964845d8788d26d80acdb96c9604555256e2..d1eaa8a17c2872cab8dc5754ae500f6d6a9eb94f 100644 (file)
@@ -958,6 +958,9 @@ isis_interface_config_write (struct vty *vty)
 
   for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
     {
+      if (ifp->ifindex == IFINDEX_DELETED)
+        continue;
+
       /* IF name */
       vty_out (vty, "interface %s%s", ifp->name, VTY_NEWLINE);
       write++;
index e02de129ac84c30389aec03b641abcb96092be8c..d8bfafbe54619137fea526f54a8c567d6e45ab2e 100644 (file)
@@ -116,7 +116,7 @@ isis_zebra_if_del (int command, struct zclient *zclient, zebra_size_t length,
      in case there is configuration info attached to it. */
   if_delete_retain(ifp);
 
-  ifp->ifindex = IFINDEX_INTERNAL;
+  ifp->ifindex = IFINDEX_DELETED;
 
   return 0;
 }
index a411e709f29eaf9b7cd044fa4928e60ff558fab7..a8e674765f1a307c92d4fc512229488ae38ce654 100644 (file)
--- a/lib/if.h
+++ b/lib/if.h
@@ -84,6 +84,7 @@ struct interface
      deleted interfaces). */
   unsigned int ifindex;
 #define IFINDEX_INTERNAL       0
+#define IFINDEX_DELETED         UINT_MAX
 
   /* Zebra internal interface status */
   u_char status;
index e81e216c5a202c426d33afeee1da6b8b88c5c636..9c738233b4d91b5601fd006e312a6ac2789e2bbc 100644 (file)
@@ -128,7 +128,7 @@ ospf6_zebra_if_del (int command, struct zclient *zclient, zebra_size_t length,
   ospf6_interface_if_del (ifp);
 #endif /*0*/
 
-  ifp->ifindex = IFINDEX_INTERNAL;
+  ifp->ifindex = IFINDEX_DELETED;
   return 0;
 }
 
index 9122a219df38076904cdd9972f3d683f3f71b64e..8cdf6e9d68969237510a3a1ddd1cdfb1b81422af 100644 (file)
@@ -9285,6 +9285,9 @@ config_write_interface (struct vty *vty)
       if (memcmp (ifp->name, "VLINK", 5) == 0)
        continue;
 
+      if (ifp->ifindex == IFINDEX_DELETED)
+        continue;
+
       vty_out (vty, "!%s", VTY_NEWLINE);
       vty_out (vty, "interface %s%s", ifp->name,
                VTY_NEWLINE);
index f79d75d476e359a92150c02c85f4b4e4534d7ba8..725bdeb4caf20027f796edc10d99fd253e15e32e 100644 (file)
@@ -148,7 +148,7 @@ ospf_interface_delete (int command, struct zclient *zclient,
     if (rn->info)
       ospf_if_free ((struct ospf_interface *) rn->info);
 
-  ifp->ifindex = IFINDEX_INTERNAL;
+  ifp->ifindex = IFINDEX_DELETED;
   return 0;
 }
 
index c9fc40e8158700a954c133804b018097886ddacc..c269ae07bcf92aa4cfae68910ddb39d187683e4c 100644 (file)
@@ -492,7 +492,7 @@ rip_interface_delete (int command, struct zclient *zclient,
   
   /* To support pseudo interface do not free interface structure.  */
   /* if_delete(ifp); */
-  ifp->ifindex = IFINDEX_INTERNAL;
+  ifp->ifindex = IFINDEX_DELETED;
 
   return 0;
 }
@@ -1928,6 +1928,9 @@ rip_interface_config_write (struct vty *vty)
     {
       struct rip_interface *ri;
 
+      if (ifp->ifindex == IFINDEX_DELETED)
+        continue;
+
       ri = ifp->info;
 
       /* Do not display the interface if there is no
index 3b3c377c815ef2d98aaebf7cdc867aa31031567a..ca7f02ef5965080b24c1463cce7dfa71b48e6f28 100644 (file)
@@ -320,7 +320,7 @@ ripng_interface_delete (int command, struct zclient *zclient,
 
   /* To support pseudo interface do not free interface structure.  */
   /* if_delete(ifp); */
-  ifp->ifindex = IFINDEX_INTERNAL;
+  ifp->ifindex = IFINDEX_DELETED;
 
   return 0;
 }