Skip to content

sit: allow to switch netns during encap/decap

Nicolas Dichtel netdev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyIn review
  2. v22 patches 7 repliesSuperseded
  3. v1 RFC2 patches 6 repliesSuperseded

Changes in v3 from the cover letter

put again the test about netns before calling skb_scrub_packet() add a missing skb_scrub_packet() call in ip_tunnel_xmit()

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2dev: introduce skb_scrub_packet()include/linux/skbuff.h net/core/dev.c net/core/skbuff.c+25 -100 replies
2/2sit: add support of x-netnsinclude/net/ip_tunnels.h net/ipv4/ip_tunnel.c net/ipv6/sit.c+42 -110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 net-next 0/2] sit: allow to switch netns during encap/decap

This patch is a follow up of the thread "switching network namespace midway":
http://marc.info/?t=135101459500004&r=1&w=2

The goal of this serie is to add x-netns support for the module sit, ie the encapsulation addresses and the network device are not owned by the same namespace.

Example to configure a tunnel:

modprobe sit
ip netns add netns1
ip link add sit1 type sit remote 10.16.0.121 local 10.16.0.249 ip l s sit1 netns netns1
ip netns exec netns1 ip l s lo up
ip netns exec netns1 ip l s sit1 up
ip netns exec netns1 ip a a dev sit1 192.168.2.123 remote 192.168.2.121 ip netns exec netns1 ip -6 a a dev sit1 2001:1234::123 remote 2001:1234::121

Once this serie is approved, I will add the same feature for the module ipip and ip6_tunnel.

v3:
put again the test about netns before calling skb_scrub_packet() add a missing skb_scrub_packet() call in ip_tunnel_xmit()

v2:
rename dev_cleanup_skb to skb_scrub_packet
move skb_scrub_packet to skbuff.c
fix netns cleanup
remove string comparison in netns cleanup
add a comment about FB device
call skb_scrub_packet() unconditionnaly
remove 'RFC'

 include/linux/skbuff.h   |  1 +
 include/net/ip_tunnels.h |  1 +
 net/core/dev.c           | 11 +----------
 net/core/skbuff.c        | 23 +++++++++++++++++++++++
 net/ipv4/ip_tunnel.c     | 10 +++++++++-
 net/ipv6/sit.c           | 42 ++++++++++++++++++++++++++++++++----------
 6 files changed, 67 insertions(+), 21 deletions(-)

Comments are welcome.

Regards,
Nicolas