#define ZEBRA_INTERFACE_ACTIVE (1 << 0)
#define ZEBRA_INTERFACE_SUB (1 << 1)
#define ZEBRA_INTERFACE_LINKDETECTION (1 << 2)
+#define ZEBRA_INTERFACE_VRF_LOOPBACK (1 << 3)
/* Interface flags. */
uint64_t flags;
char *name = NULL;
char *kind = NULL;
char *slave_kind = NULL;
+ int vrf_device = 0;
ifi = NLMSG_DATA (h);
if (kind && strcmp(kind, "vrf") == 0)
{
+ vrf_device = 1;
netlink_vrf_change(h, tb[IFLA_LINKINFO], name);
vrf_id = (vrf_id_t)ifi->ifi_index;
}
ifp = if_get_by_name_vrf (name, vrf_id);
set_ifindex(ifp, ifi->ifi_index);
ifp->flags = ifi->ifi_flags & 0x0000fffff;
+ if (vrf_device)
+ SET_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK);
ifp->mtu6 = ifp->mtu = *(uint32_t *) RTA_DATA (tb[IFLA_MTU]);
ifp->metric = 0;
char *name = NULL;
char *kind = NULL;
char *slave_kind = NULL;
+ int vrf_device = 0;
vrf_id_t vrf_id = ns_id;
if (kind && strcmp(kind, "vrf") == 0)
{
+ vrf_device = 1;
netlink_vrf_change(h, tb[IFLA_LINKINFO], name);
vrf_id = (vrf_id_t)ifi->ifi_index;
}
/* Update interface information. */
set_ifindex(ifp, ifi->ifi_index);
ifp->flags = ifi->ifi_flags & 0x0000fffff;
+ if (vrf_device)
+ SET_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK);
ifp->mtu6 = ifp->mtu = *(int *) RTA_DATA (tb[IFLA_MTU]);
ifp->metric = 0;
if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug ("RTM_DELLINK for %s(%u)", name, ifp->ifindex);
+ UNSET_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK);
if_delete_update (ifp);
}
for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
for (ALL_LIST_ELEMENTS (vrf_iter2iflist (iter), node, nnode, ifp))
{
- if (if_is_loopback (ifp) || ! if_is_operative (ifp))
+ if (if_is_loopback (ifp) ||
+ CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK) ||
+ ! if_is_operative (ifp))
continue;
zif = ifp->info;
zlog_debug ("%s(%u): Rx RA/RS len %d from %s",
ifp->name, ifp->ifindex, len, addr_str);
- if (if_is_loopback (ifp))
+ if (if_is_loopback (ifp) ||
+ CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK))
return;
/* Check interface configuration. */
ifp = vty->index;
- if (if_is_loopback (ifp))
+ if (if_is_loopback (ifp) ||
+ CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK))
{
- vty_out (vty, "Invalid interface%s", VTY_NEWLINE);
+ vty_out (vty, "Cannot configure IPv6 Router Advertisements on this interface%s", VTY_NEWLINE);
return CMD_WARNING;
}
ifp = vty->index;
- if (if_is_loopback (ifp))
+ if (if_is_loopback (ifp) ||
+ CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK))
{
- vty_out (vty, "Invalid interface%s", VTY_NEWLINE);
+ vty_out (vty, "Cannot configure IPv6 Router Advertisements on this interface%s", VTY_NEWLINE);
return CMD_WARNING;
}
zif = ifp->info;
- if (! if_is_loopback (ifp))
+ if (!(if_is_loopback (ifp) ||
+ CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK)))
{
if (ipv6_address_configured(ifp))
{
interface_ipv6_auto_ra_allowed (struct interface *ifp)
{
#if defined (HAVE_RTADV)
+ if (if_is_loopback (ifp) ||
+ CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK))
+ return 0;
#if defined (HAVE_CUMULUS)
if ((strncmp (ifp->name, "eth", strlen("eth")) == 0) ||
- (strncmp (ifp->name, "lo", strlen("lo")) == 0) ||
(strncmp (ifp->name, "switch", strlen("switch")) == 0))
return 0;
#endif