ipv6/udp: use sticky pktinfo egress ifindex on connect()
authorPaolo Abeni <pabeni@redhat.com>
Fri, 29 Jan 2016 11:30:20 +0000 (12:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Mar 2016 23:07:05 +0000 (15:07 -0800)
commite1c4e14bf12eb0a7179eedde41e3a94877a08802
tree20dee2170c34658bdb4a9167a3784476eb793e30
parente8e729ccd2fee9f0445c4949a1aa7dd610bfa8bd
ipv6/udp: use sticky pktinfo egress ifindex on connect()

[ Upstream commit 1cdda91871470f15e79375991bd2eddc6e86ddb1 ]

Currently, the egress interface index specified via IPV6_PKTINFO
is ignored by __ip6_datagram_connect(), so that RFC 3542 section 6.7
can be subverted when the user space application calls connect()
before sendmsg().
Fix it by initializing properly flowi6_oif in connect() before
performing the route lookup.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv6/datagram.c