From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
To: hannes@stressinduktion.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH V2] ipv6: handle Redirect ICMP Message with no Redirected Header option
Date: Wed, 21 Aug 2013 10:12:25 +0800 [thread overview]
Message-ID: <52142209.6030406@cn.fujitsu.com> (raw)
In-Reply-To: <20130820115020.GB3938@order.stressinduktion.org>
于 2013年08月20日 19:50, Hannes Frederic Sowa 写道:
> On Tue, Aug 20, 2013 at 03:13:41PM +0800, Duan Jiong wrote:
>> --- a/net/ipv6/route.c
>> +++ b/net/ipv6/route.c
>> @@ -1178,6 +1178,28 @@ void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark)
>> }
>> EXPORT_SYMBOL_GPL(ip6_redirect);
>>
>> +void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
>> + u32 mark)
>> +{
>> + const struct ipv6hdr *iph = (struct ipv6hdr *)skb_network_header(skb);
>
> Was there a problem with ipv6_hdr?
>
Actually ipv6_hdr is better, and i will modify it.
>> + const struct rd_msg *msg = (struct rd_msg *)skb_transport_header(skb);
>> + struct dst_entry *dst;
>> + struct flowi6 fl6;
>> +
>> + memset(&fl6, 0, sizeof(fl6));
>> + fl6.flowi6_oif = oif;
>> + fl6.flowi6_mark = mark;
>> + fl6.flowi6_flags = 0;
>> + fl6.daddr = msg->dest;
>> + fl6.saddr = iph->daddr;
>> +
>> + dst = ip6_route_output(net, NULL, &fl6);
>> + if (!dst->error)
>> + rt6_do_redirect(dst, NULL, skb);
>> + dst_release(dst);
>> +}
>> +EXPORT_SYMBOL_GPL(ip6_redirect_no_header);
>> +
>> void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk)
>> {
>> ip6_redirect(skb, sock_net(sk), sk->sk_bound_dev_if, sk->sk_mark);
>
> Introducing a new function here is the right thing. Maybe you could have
> a look how these redirects could be fed to raw sockets, too?
>
Because of no Redirected Header option, so we don't have enough
information to find out the related raw socket. So, there is no need
to deal with that condition.
Thanks,
Duan
next prev parent reply other threads:[~2013-08-21 2:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-20 7:13 [PATCH V2] ipv6: handle Redirect ICMP Message with no Redirected Header option Duan Jiong
2013-08-20 11:50 ` Hannes Frederic Sowa
2013-08-21 2:12 ` Duan Jiong [this message]
2013-08-21 3:04 ` Hannes Frederic Sowa
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=52142209.6030406@cn.fujitsu.com \
--to=duanj.fnst@cn.fujitsu.com \
--cc=davem@davemloft.net \
--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