Skip to content

Fix Network namespace shutdown take 2

Eric W. Biederman containers netdev 1 version Applied

Status from this message: Applied.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 of 3 patches 9 repliesApplied

2 of 3 patches are in this archive. The cover letter announces 3.

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
2/3tcp: Like icmp use register_pernet_subsysnet/ipv4/tcp_ipv4.c+1 -12 replies
3/3netns: Remove net_aliveinclude/net/net_namespace.h net/core/dev.c net/core/net_namespace.c+17 -191 reply

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDenis V. Lunev
SeriesA-b
2/3A-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] Fix Network namespace shutdown take 2

6 months ago when I introduced net_alive I fixed the symptoms but I failed to properly fix network namespace shutdown.

I realized this when I received a bug report on Tuesday about a failure in icmp_send caused by packets in the arp_gueue.

It turns out that the net_alive check in netif_receive_skb is completely unnecessary and just masked the real problem.

If we remove all network devices from a network namespace before we shutdown network subsystems and protocols then as designed we cannot have packets in flight causing problems.

It turns out that the root cause of these problems is that the icmp code was calling register_pernet_device instead of register_pernet_subsys and so it's cleanup was happening much too early.

The following patchset which should work against both 2.6.29-rcX and net-next fixes the registration problems and removes the unncessary net_alive check, making the code simpler and hopefully more comprehensible.

Eric