diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2019-10-03 17:11:37 +0200 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2020-05-18 14:11:03 +0200 |
commit | b5b453a2d6af58692bee0e256fe1dffe99824801 (patch) | |
tree | 04b8af403f74f5f14f984c66b21d2c511d83cb02 /zebra/if_netlink.c | |
parent | zebra, lib: new API to get absolute netns val from relative netns val (diff) | |
download | frr-b5b453a2d6af58692bee0e256fe1dffe99824801.tar.xz frr-b5b453a2d6af58692bee0e256fe1dffe99824801.zip |
zebra: bridge layer2 information records ns_id where bridge is
when working with vrf netns backend, two bridges interfaces may have the
same bridge interface index, but not the same namespace. because in vrf
netns backend mode, a bridge slave always belong to the same network
namespace, then a check with the namespace id and the ns id of the
bridge interface permits to resolve correctly the interface pointer.
The problem could occur if a same index of two bridge interfaces can be
found on two different namespaces.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/if_netlink.c')
-rw-r--r-- | zebra/if_netlink.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index 782de87a7..55bcda818 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -774,7 +774,7 @@ static int netlink_interface(struct nlmsghdr *h, ns_id_t ns_id, int startup) netlink_interface_update_l2info(ifp, linkinfo[IFLA_INFO_DATA], 1, link_nsid); if (IS_ZEBRA_IF_BRIDGE_SLAVE(ifp)) - zebra_l2if_update_bridge_slave(ifp, bridge_ifindex); + zebra_l2if_update_bridge_slave(ifp, bridge_ifindex, ns_id); else if (IS_ZEBRA_IF_BOND_SLAVE(ifp)) zebra_l2if_update_bond_slave(ifp, bond_ifindex); @@ -1351,7 +1351,8 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup) 1, link_nsid); if (IS_ZEBRA_IF_BRIDGE_SLAVE(ifp)) zebra_l2if_update_bridge_slave(ifp, - bridge_ifindex); + bridge_ifindex, + ns_id); else if (IS_ZEBRA_IF_BOND_SLAVE(ifp)) zebra_l2if_update_bond_slave(ifp, bond_ifindex); } else if (ifp->vrf_id != vrf_id) { @@ -1454,7 +1455,8 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup) 0, link_nsid); if (IS_ZEBRA_IF_BRIDGE_SLAVE(ifp) || was_bridge_slave) zebra_l2if_update_bridge_slave(ifp, - bridge_ifindex); + bridge_ifindex, + ns_id); else if (IS_ZEBRA_IF_BOND_SLAVE(ifp) || was_bond_slave) zebra_l2if_update_bond_slave(ifp, bond_ifindex); } |