All of lore.kernel.org
 help / color / mirror / Atom feed
From: Allison Henderson <achender@kernel.org>
To: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	pabeni@redhat.com, edumazet@google.com, kuba@kernel.org,
	horms@kernel.org
Cc: achender@kernel.org
Subject: [PATCH net-next v4 2/2] net/rds: log the port a listener actually bound
Date: Sat, 26 Sep 2026 23:30:58 -0700	[thread overview]
Message-ID: <20260927063058.170273-3-achender@kernel.org> (raw)
In-Reply-To: <20260927063058.170273-1-achender@kernel.org>

rds_rdma_listen_init_common() reports every listener as being on
RDS_PORT, but only the IPv4 caller binds that port; the IPv6 listener
is bound to RDS_CM_PORT, as rds_rdma_listen_init() explains, and its
debug line has claimed 18634 instead of 16385 since it was added.

Print the port from the address the helper just bound.

Assisted-by: Claude-Code:claude-fable-5
Signed-off-by: Allison Henderson <achender@kernel.org>
---
 net/rds/rdma_transport.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c
index 91ff1dde26af..3f853004c490 100644
--- a/net/rds/rdma_transport.c
+++ b/net/rds/rdma_transport.c
@@ -236,7 +236,10 @@ static int rds_rdma_listen_init_common(rdma_cm_event_handler handler,
 		goto out;
 	}
 
-	rdsdebug("cm %p listening on port %u\n", cm_id, RDS_PORT);
+	rdsdebug("cm %p listening on port %u\n", cm_id,
+		 ntohs(sa->sa_family == AF_INET6 ?
+		       ((struct sockaddr_in6 *)sa)->sin6_port :
+		       ((struct sockaddr_in *)sa)->sin_port));
 
 	*ret_cm_id = cm_id;
 	cm_id = NULL;
-- 
2.25.1


  parent reply	other threads:[~2026-09-27  6:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-27  6:30 [PATCH net-next v4 0/2] net/rds: restrict the rdma_cm ids to IB devices Allison Henderson
2026-09-27  6:30 ` [PATCH net-next v4 1/2] " Allison Henderson
2026-09-27  6:37   ` sashiko-bot
2026-10-01 12:32   ` Simon Horman
2026-09-27  6:30 ` Allison Henderson [this message]
2026-09-27  6:37   ` [PATCH net-next v4 2/2] net/rds: log the port a listener actually bound sashiko-bot
2026-10-01 12:32   ` Simon Horman
2026-10-02  0:20 ` [PATCH net-next v4 0/2] net/rds: restrict the rdma_cm ids to IB devices patchwork-bot+netdevbpf

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=20260927063058.170273-3-achender@kernel.org \
    --to=achender@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --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.