diff options
Diffstat (limited to 'zebra')
| -rw-r--r-- | zebra/if_netlink.c | 14 | ||||
| -rw-r--r-- | zebra/interface.c | 12 |
2 files changed, 19 insertions, 7 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index 59ab8c9d33..35cb3a6f5f 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -1385,6 +1385,13 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup) else if (IS_ZEBRA_IF_BOND_SLAVE(ifp) || was_bond_slave) zebra_l2if_update_bond_slave(ifp, bond_ifindex); } + + zif = ifp->info; + if (zif) { + XFREE(MTYPE_TMP, zif->desc); + if (desc) + zif->desc = XSTRDUP(MTYPE_TMP, desc); + } } else { /* Delete interface notification from kernel */ if (ifp == NULL) { @@ -1411,13 +1418,6 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup) if_delete_update(ifp); } - zif = ifp->info; - if (zif) { - XFREE(MTYPE_TMP, zif->desc); - if (desc) - zif->desc = XSTRDUP(MTYPE_TMP, desc); - } - return 0; } diff --git a/zebra/interface.c b/zebra/interface.c index a724006e27..ef03cf87f6 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -778,6 +778,13 @@ void if_delete_update(struct interface *ifp) memset(&zif->brslave_info, 0, sizeof(struct zebra_l2info_brslave)); } + + if (!ifp->configured) { + if (IS_ZEBRA_DEBUG_KERNEL) + zlog_debug("interface %s is being deleted from the system", + ifp->name); + if_delete(ifp); + } } /* VRF change for an interface */ @@ -3207,6 +3214,11 @@ void zebra_if_init(void) install_node(&interface_node, if_config_write); install_node(&link_params_node, NULL); if_cmd_init(); + /* + * This is *intentionally* setting this to NULL, signaling + * that interface creation for zebra acts differently + */ + if_zapi_callbacks(NULL, NULL, NULL, NULL); install_element(VIEW_NODE, &show_interface_cmd); install_element(VIEW_NODE, &show_interface_vrf_all_cmd); |
