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 <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2019-09-19 13:27:04 -04:00
parent 16296beaa5
commit 26f135777c

View File

@ -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;
}