From: Yang Hongyang <yanghy@cn.fujitsu.com>
To: "Rémi Denis-Courmont" <remi.denis-courmont@nokia.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Subject: Re: [RFC][PATCH 3/3]ipv6:fix the outgoing interface selection order in udpv6_sendmsg()
Date: Wed, 10 Dec 2008 08:42:20 +0800 [thread overview]
Message-ID: <493F106C.8030803@cn.fujitsu.com> (raw)
In-Reply-To: <200812090932.56865.remi.denis-courmont@nokia.com>
Rémi Denis-Courmont wrote:
> On Tuesday 09 December 2008 09:12:59 ext Yang Hongyang, you wrote:
>> 1.When no interface is specified in an IPV6_PKTINFO ancillary data
>> item, the interface specified in an IPV6_PKTINFO sticky optionis
>> is used.
>
>> diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
>> index 8b48512..addd856 100644
>> --- a/net/ipv6/udp.c
>> +++ b/net/ipv6/udp.c
>> @@ -761,6 +761,9 @@ do_udp_sendmsg:
>> }
>>
>> if (!fl.oif)
>> + fl.oif = np->sticky_pktinfo.ipi6_ifindex;
>> +
>> + if (!fl.oif)
>> fl.oif = sk->sk_bound_dev_if;
>>
>> if (msg->msg_controllen) {
>
> I believe overriding the outgoing interface is only allowed for link-local
> destinations, _or_ with privileges (as with SO_BINDTODEVICE).
>
> This patch seems to change this, and I am not convinced it's a good idea.
>
It does not overriding the outgoing interface.
when no interface is specified in an IPV6_PKTINFO ancillary data item(as with
SO_BINDTODEVICE), the interface specified in an IPV6_PKTINFO sticky
optionins is used.
If outgoing interface is set with SO_BINDTODEVICE and also sticky pktinfo
the outgoing interface is exactly what SO_BINDTODEVICE set,because in my
first patch,when set sticy pktinfo,outgoing interface set by SO_BINDTODEVICE
is checked:
+ if(sk->sk_bound_dev_if && pkt.ipi6_ifindex != sk->sk_bound_dev_if)
+ goto e_inval;
next prev parent reply other threads:[~2008-12-10 0:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-09 7:12 [RFC][PATCH 3/3]ipv6:fix the outgoing interface selection order in udpv6_sendmsg() Yang Hongyang
2008-12-09 7:32 ` Rémi Denis-Courmont
2008-12-10 0:42 ` Yang Hongyang [this message]
2008-12-10 6:16 ` David Miller
2008-12-10 6:33 ` Yang Hongyang
2008-12-10 6:38 ` Yang Hongyang
2008-12-10 9:15 ` David Miller
2008-12-10 9:41 ` Yang Hongyang
2008-12-16 10:09 ` David Miller
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=493F106C.8030803@cn.fujitsu.com \
--to=yanghy@cn.fujitsu.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=remi.denis-courmont@nokia.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.