netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/4] Add missed tunnel64_err handler
@ 2007-11-09 13:14 Pavel Emelyanov
  2007-11-11  5:48 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Emelyanov @ 2007-11-09 13:14 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List, devel

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?

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

diff --git a/net/ipv4/tunnel4.c b/net/ipv4/tunnel4.c
index c71617c..7938430 100644
--- a/net/ipv4/tunnel4.c
+++ b/net/ipv4/tunnel4.c
@@ -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
-- 
1.5.3.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/4] Add missed tunnel64_err handler
  2007-11-09 13:14 [PATCH 2/4] Add missed tunnel64_err handler Pavel Emelyanov
@ 2007-11-11  5:48 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2007-11-11  5:48 UTC (permalink / raw)
  To: xemul; +Cc: netdev, devel

From: Pavel Emelyanov <xemul@openvz.org>
Date: Fri, 09 Nov 2007 16:14:12 +0300

> 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?
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

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

Patch applied, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-11  5:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-09 13:14 [PATCH 2/4] Add missed tunnel64_err handler Pavel Emelyanov
2007-11-11  5:48 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).