Skip to contentSkip to conversation

net/ipv6/sit.c: return unhandled skb to tunnel4_rcv

PATCH Applied David McCullough 3 participants 3 messages Nov 30, 2010 – Dec 1, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ipv6/sit.c: return unhandled skb to tunnel4_rcv

Hi all,

I found a problem using an IPv6 over IPv4 tunnel. When CONFIG_IPV6_SIT was enabled, the packets would be rejected as net/ipv6/sit.c was catching all IPPROTO_IPV6 packets and returning an ICMP port unreachable error.

I think this patch fixes the problem cleanly. I believe the code in net/ipv4/tunnel4.c:tunnel4_rcv takes care of it properly if none of the handlers claim the skb.

Patch is against 2.6.35, bit still applies to current.

Cheers,
Davidm

net/ipv6/sit.c +2 -1
diff -u -r1.1.1.45 sit.c
@@ -575,8 +575,9 @@
 		return 0;
 	}
 
-	icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
+	/* no tunnel matched,  let upstream know, ipsec may handle it */
 	rcu_read_unlock();
+	return 1;
 out:
 	kfree_skb(skb);
 	return 0;
Signature · 2 lines
David McCullough,      [email protected],  Ph:+61 734352815
McAfee - SnapGear      http://www.mcafee.com         http://www.uCdot.org
Acked-by on v1 1/1
#1 lore raw
Quoted 22 lines · David McCullough

Hi all,

I found a problem using an IPv6 over IPv4 tunnel. When CONFIG_IPV6_SIT was enabled, the packets would be rejected as net/ipv6/sit.c was catching all IPPROTO_IPV6 packets and returning an ICMP port unreachable error.

I think this patch fixes the problem cleanly. I believe the code in net/ipv4/tunnel4.c:tunnel4_rcv takes care of it properly if none of the handlers claim the skb.

Patch is against 2.6.35, bit still applies to current.

Cheers,
Davidm

diff -u -r1.1.1.45 sit.c

net/ipv6/sit.c line 583

Quoted 10 lines
net/ipv6/sit.c +2 -1
@@ -575,8 +575,9 @@
 		return 0;
 	}
 
-	icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
+	/* no tunnel matched,  let upstream know, ipsec may handle it */
 	rcu_read_unlock();
+	return 1;
 out:
 	kfree_skb(skb);
 	return 0;

Good catch !

maintainer Applied
#2 lore raw

From: Eric Dumazet <[email protected]>
Date: Tue, 30 Nov 2010 07:12:44 +0100

Quoted 17 lines · David McCullough
Quoted 16 lines

Hi all,

I found a problem using an IPv6 over IPv4 tunnel. When CONFIG_IPV6_SIT was enabled, the packets would be rejected as net/ipv6/sit.c was catching all IPPROTO_IPV6 packets and returning an ICMP port unreachable error.

I think this patch fixes the problem cleanly. I believe the code in net/ipv4/tunnel4.c:tunnel4_rcv takes care of it properly if none of the handlers claim the skb.

Patch is against 2.6.35, bit still applies to current.

Cheers,
Davidm

...

Quoted 3 lines

Good catch !

Applied, thanks.