From: Donald Sharp Date: Thu, 19 Sep 2019 17:27:04 +0000 (-0400) Subject: zebra: Saving interface description makes no sense on deletion X-Git-Tag: base_7.3~298^2~7 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=26f135777c20a5914c43fc7168b70a950e47183a;p=mirror%2Ffrr.git zebra: Saving interface description makes no sense on deletion We were storing the interface description irrelevant of whether or not it was a newlink or dellink. This makes no sense. Signed-off-by: Donald Sharp --- diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index c71b95f753..bb6b9973bf 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -1376,6 +1376,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) { @@ -1402,13 +1409,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; }