summaryrefslogtreecommitdiff
path: root/zebra/netconf_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/netconf_netlink.c')
-rw-r--r--zebra/netconf_netlink.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/zebra/netconf_netlink.c b/zebra/netconf_netlink.c
index 587f6c749e..cc6a1201a5 100644
--- a/zebra/netconf_netlink.c
+++ b/zebra/netconf_netlink.c
@@ -45,19 +45,22 @@ static struct rtattr *netconf_rta(struct netconfmsg *ncm)
* Handle netconf update about a single interface: create dplane
* context, and enqueue for processing in the main zebra pthread.
*/
-static int netlink_netconf_dplane_update(ns_id_t ns_id, ifindex_t ifindex,
- enum dplane_netconf_status_e mpls_on,
- enum dplane_netconf_status_e mcast_on)
+static int
+netlink_netconf_dplane_update(ns_id_t ns_id, ifindex_t ifindex,
+ enum dplane_netconf_status_e mpls_on,
+ enum dplane_netconf_status_e mcast_on,
+ enum dplane_netconf_status_e linkdown_on)
{
struct zebra_dplane_ctx *ctx;
ctx = dplane_ctx_alloc();
dplane_ctx_set_op(ctx, DPLANE_OP_INTF_NETCONFIG);
- dplane_ctx_set_netconf_ns_id(ctx, ns_id);
- dplane_ctx_set_netconf_ifindex(ctx, ifindex);
+ dplane_ctx_set_ns_id(ctx, ns_id);
+ dplane_ctx_set_ifindex(ctx, ifindex);
dplane_ctx_set_netconf_mpls(ctx, mpls_on);
dplane_ctx_set_netconf_mcast(ctx, mcast_on);
+ dplane_ctx_set_netconf_linkdown(ctx, linkdown_on);
/* Enqueue ctx for main pthread to process */
dplane_provider_enqueue_to_zebra(ctx);
@@ -77,6 +80,8 @@ int netlink_netconf_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
uint32_t ival;
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 =
+ DPLANE_NETCONF_STATUS_UNKNOWN;
if (h->nlmsg_type != RTM_NEWNETCONF && h->nlmsg_type != RTM_DELNETCONF)
return 0;
@@ -133,12 +138,23 @@ int netlink_netconf_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
mcast_on = DPLANE_NETCONF_STATUS_DISABLED;
}
+ if (tb[NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN]) {
+ ival = *(uint32_t *)RTA_DATA(
+ tb[NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN]);
+ if (ival != 0)
+ linkdown_on = DPLANE_NETCONF_STATUS_ENABLED;
+ else
+ linkdown_on = DPLANE_NETCONF_STATUS_DISABLED;
+ }
+
if (IS_ZEBRA_DEBUG_KERNEL)
- zlog_debug("%s: interface %u is mpls on: %d multicast on: %d",
- __func__, ifindex, mpls_on, mcast_on);
+ zlog_debug(
+ "%s: interface %u is mpls on: %d multicast on: %d linkdown: %d",
+ __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, ifindex, mpls_on, mcast_on,
+ linkdown_on);
return 0;
}