]> git.baikalelectronics.ru Git - kernel.git/commit
net/ipv6: update flowi6_oif in ip6_dst_lookup_flow if not set
authorPhil Sutter <phil@nwl.cc>
Wed, 15 Jul 2015 19:56:26 +0000 (21:56 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Jul 2015 19:59:32 +0000 (12:59 -0700)
commitbab9393d04cd7b92e21a0c920c4701f85a3e4400
treeefcf1e177085ba336c29320c099fcb046de5b245
parent0debadee0e40d0613da2bb37687528541af90155
net/ipv6: update flowi6_oif in ip6_dst_lookup_flow if not set

Newly created flows don't have flowi6_oif set (at least if the
associated socket is not interface-bound). This leads to a mismatch in
__xfrm6_selector_match() for policies which specify an interface in the
selector (sel->ifindex != 0).

Backtracing shows this happens in code-paths originating from e.g.
ip6_datagram_connect(), rawv6_sendmsg() or tcp_v6_connect(). (UDP was
not tested for.)

In summary, this patch fixes policy matching on outgoing interface for
locally generated packets.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_output.c