From: Duan Jiong <djduanjiong@gmail.com>
To: Duan Jiong <duanj.fnst@cn.fujitsu.com>,
David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, hannes@stressinduktion.org
Subject: Re: [PATCH ] ip6tnl: do route updating for redirect in ip6_tnl_err()
Date: Thu, 19 Sep 2013 01:17:27 +0800 [thread overview]
Message-ID: <5239E027.9080507@gmail.com> (raw)
In-Reply-To: <5239970F.8000105@cn.fujitsu.com>
于 2013/9/18 20:05, Duan Jiong 写道:
> From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
>
> After the ip6_tnl_err() is called, the rel_msg is assigned
> to 0, and the ip4ip6_err()will return directly, the instruction
> below will not be executed.
>
> In rfc2473, we can know that the tunnel ICMP redirect
> message should not be reported to the source of the
> original packet, so we can handle it in ip4ip6_err().
>
> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
> ---
> net/ipv6/ip6_tunnel.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
> index 2d8f482..35c4b70 100644
> --- a/net/ipv6/ip6_tunnel.c
> +++ b/net/ipv6/ip6_tunnel.c
> @@ -529,6 +529,9 @@ ip6_tnl_err(struct sk_buff *skb, __u8 ipproto, struct inet6_skb_parm *opt,
> rel_msg = 1;
> }
> break;
> + case NDISC_REDIRECT:
> + ip6_redirect(skb, net, 0, 0);
sorry, it should be
ip6_redirect(skb, dev_net(skb->dev), skb->dev->ifindex, 0);
> + break;
> }
>
> *type = rel_type;
> @@ -576,9 +579,6 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
> rel_type = ICMP_DEST_UNREACH;
> rel_code = ICMP_FRAG_NEEDED;
> break;
> - case NDISC_REDIRECT:
> - rel_type = ICMP_REDIRECT;
> - rel_code = ICMP_REDIR_HOST;
> default:
> return 0;
> }
> @@ -637,8 +637,6 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
>
> skb_dst(skb2)->ops->update_pmtu(skb_dst(skb2), NULL, skb2, rel_info);
> }
> - if (rel_type == ICMP_REDIRECT)
> - skb_dst(skb2)->ops->redirect(skb_dst(skb2), NULL, skb2);
>
> icmp_send(skb2, rel_type, rel_code, htonl(rel_info));
>
prev parent reply other threads:[~2013-09-18 17:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-18 12:05 [PATCH ] ip6tnl: do route updating for redirect in ip6_tnl_err() Duan Jiong
2013-09-18 17:17 ` Duan Jiong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5239E027.9080507@gmail.com \
--to=djduanjiong@gmail.com \
--cc=davem@davemloft.net \
--cc=duanj.fnst@cn.fujitsu.com \
--cc=hannes@stressinduktion.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).