ipv6: fix source routing
commit03940f08b972c86864763556c166b7da4519d131
authorSabrina Dubroca <sd@queasysnail.net>
Tue, 25 Apr 2017 13:56:50 +0000 (25 15:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 May 2017 15:37:40 +0000 (3 08:37 -0700)
tree0bfb05e5bf64b4534f12bcbebc4135543e560a5f
parentc52ac0687247590ac5bedcbc5fe2d09cec9b0000
ipv6: fix source routing

[ Upstream commit ec9c4215fef37da6668c4105f5ad3891aaa6527a ]

Commit a149e7c7ce81 ("ipv6: sr: add support for SRH injection through
setsockopt") introduced handling of IPV6_SRCRT_TYPE_4, but at the same
time restricted it to only IPV6_SRCRT_TYPE_0 and
IPV6_SRCRT_TYPE_4. Previously, ipv6_push_exthdr() and fl6_update_dst()
would also handle other values (ie STRICT and TYPE_2).

Restore previous source routing behavior, by handling IPV6_SRCRT_STRICT
and IPV6_SRCRT_TYPE_2 the same way as IPV6_SRCRT_TYPE_0 in
ipv6_push_exthdr() and fl6_update_dst().

Fixes: a149e7c7ce81 ("ipv6: sr: add support for SRH injection through setsockopt")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-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/exthdrs.c