]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: set type for newly created interfaces
authorIgor Ryzhov <iryzhov@nfware.com>
Fri, 8 Oct 2021 21:22:31 +0000 (00:22 +0300)
committermergify-bot <noreply@mergify.io>
Mon, 11 Oct 2021 12:58:10 +0000 (12:58 +0000)
Currently, the ll_type is set only in `netlink_interface` which is
executed only during startup. If the interface is created when the FRR
is already running, the type is not stored.

Fixes #1164.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit 8975bbbdd6885b8a99be4893291a82150c254452)

zebra/if_netlink.c

index a51e0b82cb28bbb1062b4f9b08e996ccc1349c0d..d400012cb0c263173c4f6f9f298f7d8ebd7b0765 100644 (file)
@@ -1625,6 +1625,8 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
                        /* Update link. */
                        zebra_if_update_link(ifp, link_ifindex, ns_id);
 
+                       ifp->ll_type =
+                               netlink_to_zebra_link_type(ifi->ifi_type);
                        netlink_interface_update_hw_addr(tb, ifp);
 
                        /* Inform clients, install any configured addresses. */
@@ -1691,6 +1693,8 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
                        /* Update link. */
                        zebra_if_update_link(ifp, link_ifindex, ns_id);
 
+                       ifp->ll_type =
+                               netlink_to_zebra_link_type(ifi->ifi_type);
                        netlink_interface_update_hw_addr(tb, ifp);
 
                        if (if_is_no_ptm_operative(ifp)) {