diff options
author | Yang Hongyang <yanghy@cn.fujitsu.com> | 2008-12-16 05:08:29 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-16 05:08:29 -0500 |
commit | 9f690db7ff4cb32493c0b0b13334cc4f5fd49a6b (patch) | |
tree | c4f3dfb17ba368dffc5da8a8ffe575e0f99065e7 | |
parent | f250dcdac111a8369220b8e192eae6c56dc1098a (diff) |
ipv6: fix the outgoing interface selection order in udpv6_sendmsg()
1.When no interface is specified in an IPV6_PKTINFO ancillary data
item, the interface specified in an IPV6_PKTINFO sticky optionis
is used.
RFC3542:
6.7. Summary of Outgoing Interface Selection
This document and [RFC-3493] specify various methods that affect the
selection of the packet's outgoing interface. This subsection
summarizes the ordering among those in order to ensure deterministic
behavior.
For a given outgoing packet on a given socket, the outgoing interface
is determined in the following order:
1. if an interface is specified in an IPV6_PKTINFO ancillary data
item, the interface is used.
2. otherwise, if an interface is specified in an IPV6_PKTINFO sticky
option, the interface is used.
Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv6/udp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 38390dd19636..84b1a296eecb 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -793,6 +793,9 @@ do_udp_sendmsg: | |||
793 | if (!fl.oif) | 793 | if (!fl.oif) |
794 | fl.oif = sk->sk_bound_dev_if; | 794 | fl.oif = sk->sk_bound_dev_if; |
795 | 795 | ||
796 | if (!fl.oif) | ||
797 | fl.oif = np->sticky_pktinfo.ipi6_ifindex; | ||
798 | |||
796 | if (msg->msg_controllen) { | 799 | if (msg->msg_controllen) { |
797 | opt = &opt_space; | 800 | opt = &opt_space; |
798 | memset(opt, 0, sizeof(struct ipv6_txoptions)); | 801 | memset(opt, 0, sizeof(struct ipv6_txoptions)); |