diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-09-19 19:27:04 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-09-19 19:33:23 +0200 |
commit | 26f135777c20a5914c43fc7168b70a950e47183a (patch) | |
tree | bd74afa7c784fcb902ebe4a4366f9f3c2309d5c6 /zebra/if_netlink.c | |
parent | Merge pull request #4731 from mjstapp/fix_redist_update (diff) | |
download | frr-26f135777c20a5914c43fc7168b70a950e47183a.tar.xz frr-26f135777c20a5914c43fc7168b70a950e47183a.zip |
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>
Diffstat (limited to 'zebra/if_netlink.c')
-rw-r--r-- | zebra/if_netlink.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index c71b95f75..bb6b9973b 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; } |