mbox series

[v2,iproute2,0/2] iplink: Fix link-netns handling

Message ID 20241011080111.387028-1-shaw.leon@gmail.com (mailing list archive)
Headers show
Series iplink: Fix link-netns handling | expand

Message

Xiao Liang Oct. 11, 2024, 8:01 a.m. UTC
When handling something like:

    # ip -n ns1 link add netns ns2 link-netns ns3 link eth1 eth1.100 type vlan id 100

should lookup eth1 in ns3 and set IFLA_LINK_NETNSID to the id of ns3 from ns2.
But currently ip-link tries to find eth1 in ns1 and failes. This series fixes
it.

---

v2:
- Rebase in regard to
    57daf8ff8c6c ("iplink: fix fd leak when playing with netns")


Xiao Liang (2):
  ip: Move of set_netnsid_from_name() to namespace.c
  iplink: Fix link-netns id and link ifindex

 include/namespace.h |   2 +
 ip/ip_common.h      |   2 -
 ip/iplink.c         | 143 ++++++++++++++++++++++++++++++++++++--------
 ip/ipnetns.c        |  28 +--------
 lib/namespace.c     |  27 +++++++++
 5 files changed, 150 insertions(+), 52 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Oct. 17, 2024, 7:20 p.m. UTC | #1
Hello:

This series was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:

On Fri, 11 Oct 2024 16:01:07 +0800 you wrote:
> When handling something like:
> 
>     # ip -n ns1 link add netns ns2 link-netns ns3 link eth1 eth1.100 type vlan id 100
> 
> should lookup eth1 in ns3 and set IFLA_LINK_NETNSID to the id of ns3 from ns2.
> But currently ip-link tries to find eth1 in ns1 and failes. This series fixes
> it.
> 
> [...]

Here is the summary with links:
  - [v2,iproute2,1/2] ip: Move of set_netnsid_from_name() to namespace.c
    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=18bbd74b345f
  - [v2,iproute2,2/2] iplink: Fix link-netns id and link ifindex
    (no matching commit)

You are awesome, thank you!