All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Sitnicki <jakub@cloudflare.com>
To: netdev@vger.kernel.org
Cc: Eric Dumazet <edumazet@google.com>,
	 Paolo Abeni <pabeni@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	 Jakub Kicinski <kuba@kernel.org>,
	 Neal Cardwell <ncardwell@google.com>,
	 Kuniyuki Iwashima <kuniyu@google.com>,
	 netdev@vger.kernel.org, kernel-team@cloudflare.com,
	 Lee Valentine <lvalentine@cloudflare.com>
Subject: Re: [PATCH net-next 1/2] tcp: Consider every port when connecting with IP_LOCAL_PORT_RANGE
Date: Fri, 27 Jun 2025 11:58:18 +0200	[thread overview]
Message-ID: <87ecv5fqv9.fsf@cloudflare.com> (raw)
In-Reply-To: <202506270619.Cjd8lmig-lkp@intel.com> (kernel test robot's message of "Fri, 27 Jun 2025 07:00:59 +0800")

On Fri, Jun 27, 2025 at 07:00 AM +08, kernel test robot wrote:
> All warnings (new ones prefixed by >>):
>
>>> net/ipv4/inet_hashtables.c:1015:21: warning: unused variable 'sk2' [-Wunused-variable]
>     1015 |         const struct sock *sk2;
>          |                            ^~~
>    1 warning generated.
>
>
> vim +/sk2 +1015 net/ipv4/inet_hashtables.c
>
>   1007	
>   1008	/* True on source address conflict with another socket. False otherwise.
>   1009	 * Caller must hold hashbucket lock for this tb.
>   1010	 */
>   1011	static inline bool check_bound(const struct sock *sk,
>   1012				       const struct inet_bind_bucket *tb)
>   1013	{
>   1014		const struct inet_bind2_bucket *tb2;
>> 1015		const struct sock *sk2;
>   1016	
>   1017		hlist_for_each_entry(tb2, &tb->bhash2, bhash_node) {
>   1018	#if IS_ENABLED(CONFIG_IPV6)
>   1019			if (sk->sk_family == AF_INET6) {
>   1020				if (tb2->addr_type == IPV6_ADDR_ANY ||
>   1021				    ipv6_addr_equal(&tb2->v6_rcv_saddr,
>   1022						    &sk->sk_v6_rcv_saddr))
>   1023					return true;
>   1024				continue;
>   1025			}
>   1026	
>   1027			/* Check for ipv6 non-v6only wildcard sockets */
>   1028			if (tb2->addr_type == IPV6_ADDR_ANY)
>   1029				sk_for_each_bound(sk2, &tb2->owners)
>   1030					if (!sk2->sk_ipv6only)
>   1031						return true;
>   1032	
>   1033			if (tb2->addr_type != IPV6_ADDR_MAPPED)
>   1034				continue;
>   1035	#endif
>   1036			if (tb2->rcv_saddr == INADDR_ANY ||
>   1037			    tb2->rcv_saddr == sk->sk_rcv_saddr)
>   1038				return true;
>   1039		}
>   1040	
>   1041		return false;
>   1042	}
>   1043	

FYI for the reviewers -

Silly mistake. I can move the sk2 declaration inside the branch where we
walk over the v6 wildcard sockets.

Holding off for now to give people a chance to review.

  reply	other threads:[~2025-06-27  9:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-26 12:02 [PATCH net-next 1/2] tcp: Consider every port when connecting with IP_LOCAL_PORT_RANGE Jakub Sitnicki
2025-06-26 12:02 ` [PATCH net-next 2/2] selftests/net: Cover port sharing scenarios " Jakub Sitnicki
2025-06-26 23:00 ` [PATCH net-next 1/2] tcp: Consider every port when connecting " kernel test robot
2025-06-27  9:58   ` Jakub Sitnicki [this message]
2025-06-27 11:19 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ecv5fqv9.fsf@cloudflare.com \
    --to=jakub@cloudflare.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel-team@cloudflare.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=lvalentine@cloudflare.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.