]> 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)
committerIgor Ryzhov <iryzhov@nfware.com>
Fri, 8 Oct 2021 21:23:39 +0000 (00:23 +0300)
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>
zebra/if_netlink.c

index 15645d024df530ff42d29637bb1c10adc8d1fb1b..9385418655ce98a4f69e6076145d20cf931bbf31 100644 (file)
@@ -1832,6 +1832,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. */
@@ -1899,6 +1901,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)) {