net: Only honor ifindex in IP_PKTINFO if non-0
authorDavid Ahern <dsahern@gmail.com>
Fri, 16 Feb 2018 19:03:03 +0000 (11:03 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Mar 2018 16:11:34 +0000 (18:11 +0200)
commit5f02dcec3653abb204cb23e25132f49eb314c84f
tree299c323161c2f2d08776fd59166293e8b13fe481
parent455fc99cb4e8222c40cf9ae97f4e5845bdcac17c
net: Only honor ifindex in IP_PKTINFO if non-0

[ Upstream commit 2cbb4ea7de167b02ffa63e9cdfdb07a7e7094615 ]

Only allow ifindex from IP_PKTINFO to override SO_BINDTODEVICE settings
if the index is actually set in the message.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/ip_sockglue.c