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)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 30 Apr 2016 22:05:25 +0000 (00:05 +0200)
commitcc84cca6a658e456cb4479adb4ff22308fa802d4
tree337c02db62a1bfcf25abdbabb736a74f52c77ce5
parent2f3361f333a5937dd3f20d17a826bf1bb150ea54
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: Ben Hutchings <ben@decadent.org.uk>
net/ipv6/datagram.c