Skip to content

Commit

Permalink
[INET]: Add missed tunnel64_err handler
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Nov 11, 2007
1 parent c2b4233 commit 99f9332
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion net/ipv4/tunnel4.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,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,
Expand All @@ -127,7 +138,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
Expand Down

0 comments on commit 99f9332

Please sign in to comment.