From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Cc: dsahern@kernel.org, Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH iproute2-next 09/10] ss: fix shadowed variable warnings
Date: Mon, 30 Nov 2026 10:47:10 -0800 [thread overview]
Message-ID: <20261130184752.545119-10-stephen@networkplumber.org> (raw)
In-Reply-To: <20261130184752.545119-1-stephen@networkplumber.org>
Rename variables to avoid shadowing.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
ss/inet.c | 11 +++++------
ss/tcp.c | 6 +++---
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/ss/inet.c b/ss/inet.c
index 53720983..d916e23b 100644
--- a/ss/inet.c
+++ b/ss/inet.c
@@ -478,14 +478,13 @@ static int tcp_show_netlink_file(struct filter *f)
err = -1;
if (h->nlmsg_type == NLMSG_ERROR) {
- struct nlmsgerr *err = (struct nlmsgerr *)NLMSG_DATA(h);
+ const struct nlmsgerr *emsg = NLMSG_DATA(h);
- if (h->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr))) {
+ if (h->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr)))
fprintf(stderr, "ERROR truncated\n");
- } else {
- errno = -err->error;
- perror("TCPDIAG answered");
- }
+ else
+ fprintf(stderr, "TCPDIAG answered: %s\n",
+ strerror(-emsg->error));
break;
}
diff --git a/ss/tcp.c b/ss/tcp.c
index 36e8cb3a..5809f9fb 100644
--- a/ss/tcp.c
+++ b/ss/tcp.c
@@ -451,12 +451,12 @@ void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
if (tb[INET_DIAG_BBRINFO]) {
const void *bbr_info = RTA_DATA(tb[INET_DIAG_BBRINFO]);
- int len = min(RTA_PAYLOAD(tb[INET_DIAG_BBRINFO]),
- sizeof(*s.bbr_info));
+ int bbr_len = min(RTA_PAYLOAD(tb[INET_DIAG_BBRINFO]),
+ sizeof(*s.bbr_info));
s.bbr_info = calloc(1, sizeof(*s.bbr_info));
if (s.bbr_info && bbr_info)
- memcpy(s.bbr_info, bbr_info, len);
+ memcpy(s.bbr_info, bbr_info, bbr_len);
}
if (rtt > 0 && info->tcpi_snd_mss && info->tcpi_snd_cwnd) {
--
2.53.0
next prev parent reply other threads:[~2026-11-30 19:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 18:47 [PATCH iproute2-next 00/10] fix shadowed variable warnings Stephen Hemminger
2026-11-30 18:47 ` [PATCH iproute2-next 01/10] xfrm: rename shadowed SA direction local Stephen Hemminger
2026-11-30 18:47 ` [PATCH iproute2-next 02/10] ip address: rename the shadowed parameter of ipaddr_reset_filter() Stephen Hemminger
2026-11-30 18:47 ` [PATCH iproute2-next 03/10] lib: rename parameters that shadow globals Stephen Hemminger
2026-11-30 18:47 ` [PATCH iproute2-next 04/10] xfrm: rename local netlink handles that shadow the global rth Stephen Hemminger
2026-11-30 18:47 ` [PATCH iproute2-next 05/10] tc: rename and drop shadowing locals Stephen Hemminger
2026-11-30 18:47 ` [PATCH iproute2-next 06/10] ip: " Stephen Hemminger
2026-11-30 18:47 ` [PATCH iproute2-next 07/10] ifstat: rename shadowing local Stephen Hemminger
2026-11-30 18:47 ` [PATCH iproute2-next 08/10] bridge, devlink, rdma: rename shadowing locals Stephen Hemminger
2026-11-30 18:47 ` Stephen Hemminger [this message]
2026-11-30 18:47 ` [PATCH iproute2-next 10/10] Makefile: enable shadowed variable warnings Stephen Hemminger
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=20261130184752.545119-10-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dsahern@kernel.org \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox