]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: Saving interface description makes no sense on deletion
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 19 Sep 2019 17:27:04 +0000 (13:27 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 19 Sep 2019 17:33:23 +0000 (13:33 -0400)
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>
zebra/if_netlink.c

index c71b95f753ad894648408b6962691642db21d69b..bb6b9973bf51be1b33df6eef94c6f1bd505d7ee6 100644 (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;
 }