[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200601.154800.618496062435048134.davem@davemloft.net>
Date: Mon, 01 Jun 2020 15:48:00 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: liuhangbin@...il.com
Cc: netdev@...r.kernel.org, john.haxby@...cle.com, edumazet@...gle.com,
kuznet@....inr.ac.ru, yoshfuji@...ux-ipv6.org, kuba@...nel.org,
stable@...r.kernel.org
Subject: Re: [PATCH net] ipv6: fix IPV6_ADDRFORM operation logic
From: Hangbin Liu <liuhangbin@...il.com>
Date: Mon, 1 Jun 2020 11:55:03 +0800
> Socket option IPV6_ADDRFORM supports UDP/UDPLITE and TCP at present.
> Previously the checking logic looks like:
> if (sk->sk_protocol == IPPROTO_UDP || sk->sk_protocol == IPPROTO_UDPLITE)
> do_some_check;
> else if (sk->sk_protocol != IPPROTO_TCP)
> break;
>
> After commit b6f6118901d1 ("ipv6: restrict IPV6_ADDRFORM operation"), TCP
> was blocked as the logic changed to:
> if (sk->sk_protocol == IPPROTO_UDP || sk->sk_protocol == IPPROTO_UDPLITE)
> do_some_check;
> else if (sk->sk_protocol == IPPROTO_TCP)
> do_some_check;
> break;
> else
> break;
>
> Then after commit 82c9ae440857 ("ipv6: fix restrict IPV6_ADDRFORM operation")
> UDP/UDPLITE were blocked as the logic changed to:
> if (sk->sk_protocol == IPPROTO_UDP || sk->sk_protocol == IPPROTO_UDPLITE)
> do_some_check;
> if (sk->sk_protocol == IPPROTO_TCP)
> do_some_check;
>
> if (sk->sk_protocol != IPPROTO_TCP)
> break;
>
> Fix it by using Eric's code and simply remove the break in TCP check, which
> looks like:
> if (sk->sk_protocol == IPPROTO_UDP || sk->sk_protocol == IPPROTO_UDPLITE)
> do_some_check;
> else if (sk->sk_protocol == IPPROTO_TCP)
> do_some_check;
> else
> break;
>
> Fixes: 82c9ae440857 ("ipv6: fix restrict IPV6_ADDRFORM operation")
> Signed-off-by: Hangbin Liu <liuhangbin@...il.com>
Applied, thank you.
Powered by blists - more mailing lists