ipv6: Fix getsockopt() for sockets with default IPV6_AUTOFLOWLABEL
authorBen Hutchings <ben.hutchings@codethink.co.uk>
Mon, 22 Jan 2018 20:06:42 +0000 (20:06 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jan 2018 13:03:44 +0000 (14:03 +0100)
commit2295b3dd543f9a5a1834e4265d506a5bc0819983
tree0ce7bc7da2ae35375f639e850019a1fb1e805451
parentc277f3420a638d455162a8bfccb40ebe22ba57b4
ipv6: Fix getsockopt() for sockets with default IPV6_AUTOFLOWLABEL

[ Upstream commit e9191ffb65d8e159680ce0ad2224e1acbde6985c ]

Commit 513674b5a2c9 ("net: reevalulate autoflowlabel setting after
sysctl setting") removed the initialisation of
ipv6_pinfo::autoflowlabel and added a second flag to indicate
whether this field or the net namespace default should be used.

The getsockopt() handling for this case was not updated, so it
currently returns 0 for all sockets for which IPV6_AUTOFLOWLABEL is
not explicitly enabled.  Fix it to return the effective value, whether
that has been set at the socket or net namespace level.

Fixes: 513674b5a2c9 ("net: reevalulate autoflowlabel setting after sysctl ...")
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/net/ipv6.h
net/ipv6/ip6_output.c
net/ipv6/ipv6_sockglue.c