mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 00:41:20 +00:00
zebra: Lookup linked interface in link netns
Look up linked interface in the correct netns, otherwise, either a wrong interface or NULL would be used. For example, enable VRF netns backend, and: ip netns add ns1 ip link add link eth0 link1 type macvlan ip link set link1 netns ns1 up Zebra will crash in zebra_vxlan_macvlan_up because zif->link is NULL. Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
This commit is contained in:
parent
ae45a63022
commit
86bad1cb6e
@ -1834,7 +1834,7 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
|
||||
ZEBRA_INTERFACE_VRF_LOOPBACK);
|
||||
|
||||
/* Update link. */
|
||||
zebra_if_update_link(ifp, link_ifindex, ns_id);
|
||||
zebra_if_update_link(ifp, link_ifindex, link_nsid);
|
||||
|
||||
ifp->ll_type =
|
||||
netlink_to_zebra_link_type(ifi->ifi_type);
|
||||
@ -1903,7 +1903,7 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
|
||||
memcpy(old_hw_addr, ifp->hw_addr, INTERFACE_HWADDR_MAX);
|
||||
|
||||
/* Update link. */
|
||||
zebra_if_update_link(ifp, link_ifindex, ns_id);
|
||||
zebra_if_update_link(ifp, link_ifindex, link_nsid);
|
||||
|
||||
ifp->ll_type =
|
||||
netlink_to_zebra_link_type(ifi->ifi_type);
|
||||
|
Loading…
Reference in New Issue
Block a user