UNSET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);
/* Enable RA suppression if there are no IPv6 addresses on this interface */
- if (! ipv6_address_configured(ifc->ifp))
- ipv6_nd_suppress_ra_set (ifc->ifp, RA_SUPPRESS);
+ if (interface_ipv6_auto_ra_allowed (ifc->ifp))
+ {
+ if (! ipv6_address_configured(ifc->ifp))
+ ipv6_nd_suppress_ra_set (ifc->ifp, RA_SUPPRESS);
+ }
if (!CHECK_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED))
{
if_subnet_add (ifp, ifc);
else if (ifc->address->family == AF_INET6)
- ipv6_nd_suppress_ra_set (ifp, RA_ENABLE);
+ {
+ if (interface_ipv6_auto_ra_allowed (ifp))
+ ipv6_nd_suppress_ra_set (ifp, RA_ENABLE);
+ }
zebra_interface_address_add_update (ifp, ifc);
/* Add to linked list. */
listnode_add (ifp->connected, ifc);
- ipv6_nd_suppress_ra_set (ifp, RA_ENABLE);
+ /* Enable RA on this interface */
+ if (interface_ipv6_auto_ra_allowed (ifp))
+ ipv6_nd_suppress_ra_set (ifp, RA_ENABLE);
}
/* This address is configured from zebra. */
}
/* Enable RA suppression if there are no IPv6 addresses on this interface */
- if (! ipv6_address_configured(ifp))
- ipv6_nd_suppress_ra_set (ifp, RA_SUPPRESS);
+ if (interface_ipv6_auto_ra_allowed (ifp))
+ {
+ if (! ipv6_address_configured(ifp))
+ ipv6_nd_suppress_ra_set (ifp, RA_SUPPRESS);
+ }
UNSET_FLAG (ifc->conf, ZEBRA_IFC_QUEUED);
/* This information will be propagated to the zclients when the
char *name = NULL;
char *kind = NULL;
char *slave_kind = NULL;
- struct connected *ifc;
- struct listnode *node;
vrf_id_t vrf_id = ns_id;
{
if_down (ifp); //Ideally, we should have down/delete come from kernel
// if_delete_update (ifp); //Pending: see how best to make the old ifp unusable
- for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, ifc))
- if (ifc->address->family == AF_INET6)
- ipv6_nd_suppress_ra_set (ifp, RA_SUPPRESS);
+ if (interface_ipv6_auto_ra_allowed (ifp))
+ {
+ if (ipv6_address_configured (ifp))
+ ipv6_nd_suppress_ra_set (ifp, RA_SUPPRESS);
+ }
}
if (ifp == NULL || !CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE) ||
{
if_update_vrf (ifp, name, strlen(name), vrf_id);
- for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, ifc))
- if (ifc->address->family == AF_INET6)
- ipv6_nd_suppress_ra_set (ifp, RA_ENABLE);
+ if (interface_ipv6_auto_ra_allowed (ifp))
+ {
+ if (ipv6_address_configured (ifp))
+ ipv6_nd_suppress_ra_set (ifp, RA_ENABLE);
+ }
}
set_ifindex(ifp, ifi->ifi_index);
extern void rtadv_cmd_init (void);
extern void ipv6_nd_suppress_ra_set (struct interface *ifp, ipv6_nd_suppress_ra_status status);
+
+/* Can we turn on IPv6 RAs automatically on this interface? */
+static inline int
+interface_ipv6_auto_ra_allowed (struct interface *ifp)
+{
+#if defined (HAVE_RTADV)
+ if ((strncmp (ifp->name, "eth", strlen("eth")) == 0) ||
+ (strncmp (ifp->name, "lo", strlen("lo")) == 0) ||
+ (strncmp (ifp->name, "switch", strlen("switch")) == 0))
+ return 0;
+ return 1;
+#else
+ return 0;
+#endif
+}
+
#endif /* _ZEBRA_RTADV_H */