* [PATCH net] ipv6: fix source routing
@ 2017-04-25 13:56 Sabrina Dubroca
2017-04-25 17:59 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Sabrina Dubroca @ 2017-04-25 13:56 UTC (permalink / raw)
To: netdev; +Cc: Sabrina Dubroca, Hannes Frederic Sowa, David Lebrun
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>
---
net/ipv6/exthdrs.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 25192a3b0cd7..d32e2110aff2 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -909,6 +909,8 @@ static void ipv6_push_rthdr(struct sk_buff *skb, u8 *proto,
{
switch (opt->type) {
case IPV6_SRCRT_TYPE_0:
+ case IPV6_SRCRT_STRICT:
+ case IPV6_SRCRT_TYPE_2:
ipv6_push_rthdr0(skb, proto, opt, addr_p, saddr);
break;
case IPV6_SRCRT_TYPE_4:
@@ -1163,6 +1165,8 @@ struct in6_addr *fl6_update_dst(struct flowi6 *fl6,
switch (opt->srcrt->type) {
case IPV6_SRCRT_TYPE_0:
+ case IPV6_SRCRT_STRICT:
+ case IPV6_SRCRT_TYPE_2:
fl6->daddr = *((struct rt0_hdr *)opt->srcrt)->addr;
break;
case IPV6_SRCRT_TYPE_4:
--
2.12.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] ipv6: fix source routing
2017-04-25 13:56 [PATCH net] ipv6: fix source routing Sabrina Dubroca
@ 2017-04-25 17:59 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-04-25 17:59 UTC (permalink / raw)
To: sd; +Cc: netdev, hannes, david.lebrun
From: Sabrina Dubroca <sd@queasysnail.net>
Date: Tue, 25 Apr 2017 15:56:50 +0200
> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-04-25 17:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-25 13:56 [PATCH net] ipv6: fix source routing Sabrina Dubroca
2017-04-25 17:59 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.