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
struct nd_router_advert *radvert;
char addr_str[INET6_ADDRSTRLEN];
struct zebra_if *zif;
+ struct prefix p;
zif = ifp->info;
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);
}
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)))
{
}
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)
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 *);