Skip to contentSkip to conversation

Add missed tunnel64_err handler

PATCH Applied Pavel Emelyanov 2 participants 2 messages Nov 9, 2007 – Nov 11, 2007

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

PATCH 2/4 Add missed tunnel64_err handler

The tunnel64_protocol uses the tunnel4_protocol's err_handler and thus calls the tunnel4_protocol's handlers.

This is not very good, as in case of (icmp) error the wrong error handlers will be called (e.g. ipip ones instead of sit) and this won't be noticed at all, because the error is not reported.

Was that made deliberately and I miss something?

---

net/ipv4/tunnel4.c +12 -1
index c71617c..7938430 100644
@@ -145,6 +145,17 @@ static void tunnel4_err(struct sk_buff *skb, u32 info)
 			break;
 }
 
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+static void tunnel64_err(struct sk_buff *skb, u32 info)
+{
+	struct xfrm_tunnel *handler;
+
+	for (handler = tunnel64_handlers; handler; handler = handler->next)
+		if (!handler->err_handler(skb, info))
+			break;
+}
+#endif
+
 static struct net_protocol tunnel4_protocol = {
 	.handler	=	tunnel4_rcv,
 	.err_handler	=	tunnel4_err,
@@ -154,7 +165,7 @@ static struct net_protocol tunnel4_protocol = {
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
 static struct net_protocol tunnel64_protocol = {
 	.handler	=	tunnel64_rcv,
-	.err_handler	=	tunnel4_err,
+	.err_handler	=	tunnel64_err,
 	.no_policy	=	1,
 };
 #endif
Signature · 1 line
1.5.3.4
maintainer
#1 lore raw

From: Pavel Emelyanov <[email protected]>
Date: Fri, 09 Nov 2007 16:14:12 +0300

Quoted 10 lines

The tunnel64_protocol uses the tunnel4_protocol's err_handler and thus calls the tunnel4_protocol's handlers.

This is not very good, as in case of (icmp) error the wrong error handlers will be called (e.g. ipip ones instead of sit) and this won't be noticed at all, because the error is not reported.

Was that made deliberately and I miss something?

This definitely was doing the wrong thing for the SIT case, for example. So this looks legitimate to me.

Patch applied, thanks!