struct interface *ifp)
{
struct zebra_if *zif;
+ afi_t afi;
enum dplane_netconf_status_e mpls, mcast_on, linkdown;
+ bool *mcast_set, *linkdown_set;
zif = ifp->info;
if (!zif) {
return;
}
+ afi = dplane_ctx_get_afi(ctx);
mpls = dplane_ctx_get_netconf_mpls(ctx);
if (mpls == DPLANE_NETCONF_STATUS_ENABLED)
else if (mpls == DPLANE_NETCONF_STATUS_DISABLED)
zif->mpls = false;
+ if (afi == AFI_IP) {
+ mcast_set = &zif->v4mcast_on;
+ linkdown_set = &zif->linkdown;
+ } else {
+ mcast_set = &zif->v6mcast_on;
+ linkdown_set = &zif->linkdownv6;
+ }
+
linkdown = dplane_ctx_get_netconf_linkdown(ctx);
if (linkdown == DPLANE_NETCONF_STATUS_ENABLED)
- zif->linkdown = true;
+ *linkdown_set = true;
else if (linkdown == DPLANE_NETCONF_STATUS_DISABLED)
- zif->linkdown = false;
+ *linkdown_set = false;
mcast_on = dplane_ctx_get_netconf_mcast(ctx);
if (mcast_on == DPLANE_NETCONF_STATUS_ENABLED)
- zif->v4mcast_on = true;
+ *mcast_set = true;
else if (mcast_on == DPLANE_NETCONF_STATUS_DISABLED)
- zif->v4mcast_on = false;
+ *mcast_set = false;
if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug(
- "%s: if %s, ifindex %d, mpls %s mc_forwarding: %s linkdown %s",
- __func__, ifp->name, ifp->ifindex,
- (zif->mpls ? "ON" : "OFF"),
- (zif->v4mcast_on ? "ON" : "OFF"),
- (zif->linkdown ? "ON" : "OFF"));
+ "%s: afi: %d if %s, ifindex %d, mpls %s mc_forwarding: %s linkdown %s",
+ __func__, afi, ifp->name, ifp->ifindex,
+ (zif->mpls ? "ON" : "OFF"), (*mcast_set ? "ON" : "OFF"),
+ (*linkdown_set ? "ON" : "OFF"));
}
void zebra_if_dplane_result(struct zebra_dplane_ctx *ctx)
vty_out(vty, " MPLS enabled\n");
if (zebra_if->linkdown)
- vty_out(vty, " Ignore all routes with linkdown\n");
+ vty_out(vty, " Ignore all v4 routes with linkdown\n");
+ if (zebra_if->linkdownv6)
+ vty_out(vty, " Ignore all v6 routes with linkdown\n");
if (zebra_if->v4mcast_on)
vty_out(vty, " v4 Multicast forwarding is on\n");
+ if (zebra_if->v6mcast_on)
+ vty_out(vty, " v6 Multicast forwarding is on\n");
/* Hardware address. */
vty_out(vty, " Type: %s\n", if_link_type_str(ifp->ll_type));
json_object_boolean_add(json_if, "mplsEnabled", zebra_if->mpls);
json_object_boolean_add(json_if, "linkDown", zebra_if->linkdown);
- json_object_boolean_add(json_if, "mcForwarding", zebra_if->v4mcast_on);
+ json_object_boolean_add(json_if, "linkDownV6", zebra_if->linkdownv6);
+ json_object_boolean_add(json_if, "mcForwardingV4",
+ zebra_if->v4mcast_on);
+ json_object_boolean_add(json_if, "mcForwardingV6",
+ zebra_if->v6mcast_on);
if (ifp->ifindex == IFINDEX_INTERNAL) {
json_object_boolean_add(json_if, "pseudoInterface", true);
* context, and enqueue for processing in the main zebra pthread.
*/
static int
-netlink_netconf_dplane_update(ns_id_t ns_id, ifindex_t ifindex,
+netlink_netconf_dplane_update(ns_id_t ns_id, afi_t afi, ifindex_t ifindex,
enum dplane_netconf_status_e mpls_on,
enum dplane_netconf_status_e mcast_on,
enum dplane_netconf_status_e linkdown_on)
ctx = dplane_ctx_alloc();
dplane_ctx_set_op(ctx, DPLANE_OP_INTF_NETCONFIG);
dplane_ctx_set_ns_id(ctx, ns_id);
+ dplane_ctx_set_afi(ctx, afi);
dplane_ctx_set_ifindex(ctx, ifindex);
dplane_ctx_set_netconf_mpls(ctx, mpls_on);
int len;
ifindex_t ifindex;
uint32_t ival;
+ afi_t afi;
enum dplane_netconf_status_e mpls_on = DPLANE_NETCONF_STATUS_UNKNOWN;
enum dplane_netconf_status_e mcast_on = DPLANE_NETCONF_STATUS_UNKNOWN;
enum dplane_netconf_status_e linkdown_on =
ncm = NLMSG_DATA(h);
+ /*
+ * FRR does not have an internal representation of afi_t for
+ * the MPLS Address Family that the kernel has. So let's
+ * just call it v4. This is ok because the kernel appears
+ * to do a good job of not sending data that is mixed/matched
+ * across families
+ */
+ if (ncm->ncm_family == AF_MPLS)
+ afi = AFI_IP;
+ else
+ afi = family2afi(ncm->ncm_family);
+
netlink_parse_rtattr(tb, NETCONFA_MAX, netconf_rta(ncm), len);
if (!tb[NETCONFA_IFINDEX]) {
__func__, ifindex, mpls_on, mcast_on, linkdown_on);
/* Create a dplane context and pass it along for processing */
- netlink_netconf_dplane_update(ns_id, ifindex, mpls_on, mcast_on,
+ netlink_netconf_dplane_update(ns_id, afi, ifindex, mpls_on, mcast_on,
linkdown_on);
return 0;