]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Accept and process RAs with lifetime of zero
authorvivek <vivek@cumulusnetworks.com>
Fri, 13 May 2016 05:57:40 +0000 (22:57 -0700)
committervivek <vivek@cumulusnetworks.com>
Fri, 13 May 2016 17:17:37 +0000 (10:17 -0700)
Fix code to not discard received RAs with a lifetime of 0. The router lifetime
is only applicable for default router processing which is not relevant here.
For the purposes of BGP unnumbered, the neighbor should be learnt without
consideration of the value of router lifetime in received RA.

Note: This patch brings in a portion of the earlier commit
690baa53592320dddee5c729f959150cc9a72699 - this included some additional
changes which have been reverted.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-10943
Reviewed By: CCR-4611
Testing Done: bgp-smoke

zebra/rtadv.c
zebra/zserv.c
zebra/zserv.h

index 02499a3557e13892c369940f75177de9be0903d6..59542481ddc4bec6862c3b954e27db2f9af8afed 100644 (file)
@@ -448,6 +448,7 @@ rtadv_process_advert (u_char *msg, unsigned int len, struct interface *ifp,
   struct nd_router_advert *radvert;
   char addr_str[INET6_ADDRSTRLEN];
   struct zebra_if *zif;
+  struct prefix p;
 
   zif = ifp->info;
 
@@ -501,15 +502,13 @@ rtadv_process_advert (u_char *msg, unsigned int len, struct interface *ifp,
                 ifp->name, ifp->ifindex, addr_str);
     }
 
-  /* Currently supporting only P2P links, so any new RA source address is
-     considered as the replacement of the previously learnt Link-Local address.
-     As per the RFC, lifetime zero is to be considered a delete */
-  if (ntohs(radvert->nd_ra_router_lifetime))
-     nbr_connected_replacement_add_ipv6(ifp, &addr->sin6_addr, 128);
-  else
-     nbr_connected_delete_ipv6(ifp, &addr->sin6_addr, 128);
+  /* Create entry for neighbor if not known. */
+  p.family = AF_INET6;
+  IPV6_ADDR_COPY (&p.u.prefix, &addr->sin6_addr);
+  p.prefixlen = IPV6_MAX_PREFIXLEN;
 
-  return;
+  if (!nbr_connected_check(ifp, &p))
+    nbr_connected_add_ipv6 (ifp, &addr->sin6_addr);
 }
 
 
index e9698a82a8481a9a4fe2d89277f7cf22cb4cce0c..d6de0792e184302ac9f2def978d54c85221f1472 100644 (file)
@@ -471,21 +471,16 @@ zsend_interface_vrf_update (struct zserv *client, struct interface *ifp,
   return zebra_server_send_message(client);
 }
 
-/* Add new nbr connected IPv6 address if none exists already, or replace the
-   existing one if an ifc entry is found on the interface. */
+/* Add new nbr connected IPv6 address */
 void
-nbr_connected_replacement_add_ipv6 (struct interface *ifp, struct in6_addr *address,
-                                    u_char prefixlen)
+nbr_connected_add_ipv6 (struct interface *ifp, struct in6_addr *address)
 {
   struct nbr_connected *ifc;
   struct prefix p;
 
   p.family = AF_INET6;
   IPV6_ADDR_COPY (&p.u.prefix, address);
-  p.prefixlen = prefixlen;
-
-  if (nbr_connected_check(ifp, &p))
-    return;
+  p.prefixlen = IPV6_MAX_PREFIXLEN;
 
   if (!(ifc = listnode_head(ifp->nbr_connected)))
     {
@@ -504,15 +499,14 @@ nbr_connected_replacement_add_ipv6 (struct interface *ifp, struct in6_addr *addr
 }
 
 void
-nbr_connected_delete_ipv6 (struct interface *ifp, struct in6_addr *address,
-                           u_char prefixlen)
+nbr_connected_delete_ipv6 (struct interface *ifp, struct in6_addr *address)
 {
   struct nbr_connected *ifc;
   struct prefix p;
 
   p.family = AF_INET6;
   IPV6_ADDR_COPY (&p.u.prefix, address);
-  p.prefixlen = prefixlen;
+  p.prefixlen = IPV6_MAX_PREFIXLEN;
 
   ifc = nbr_connected_check(ifp, &p);
   if (!ifc)
index 7fde4adb5ea3efde9f3da6b53bd1c57a931cdf55..16700ee52363d346eaeff5b30349fe6bff8e13f2 100644 (file)
@@ -155,9 +155,8 @@ extern int zsend_interface_delete (struct zserv *, struct interface *);
 extern int zsend_interface_addresses (struct zserv *, struct interface *);
 extern int zsend_interface_address (int, struct zserv *, struct interface *,
                                     struct connected *);
-extern void nbr_connected_replacement_add_ipv6 (struct interface *,
-                                                struct in6_addr *, u_char);
-extern void nbr_connected_delete_ipv6 (struct interface *, struct in6_addr *, u_char);
+extern void nbr_connected_add_ipv6 (struct interface *, struct in6_addr *);
+extern void nbr_connected_delete_ipv6 (struct interface *, struct in6_addr *);
 extern int zsend_interface_update (int, struct zserv *, struct interface *);
 extern int zsend_redistribute_route (int, struct zserv *, struct prefix *,
                                     struct rib *);