From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [RFC 1/3] ss: drop the dead /proc fallback trigger in packet_show_sock()
Date: Tue, 15 Sep 2026 14:36:02 -0700 [thread overview]
Message-ID: <20260915213646.116214-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20260915213646.116214-1-stephen@networkplumber.org>
Commit a2b31976 ("ss: drop the /proc parsers for packet and netlink
sockets") removed the /proc/net/packet fallback but left behind the
code whose only purpose was to request it:
/* use /proc/net/packet if all info are not available */
if (!tb[PACKET_DIAG_MEMINFO])
return -1;
That -1 used to propagate up so packet_show() would retry via
net_packet_open(). With no fallback left it is returned from an
rtnl_dump_filter() callback, which aborts the dump. A kernel that
omits PACKET_DIAG_MEMINFO for a socket now silently truncates the
listing at that socket: everything after it is dropped and the exit
status is still 0.
The check is redundant anyway. The code below already guards the
attribute with "if (tb[PACKET_DIAG_MEMINFO])" and simply leaves
stat.rq at 0 when it is absent, which is how the netlink path treats
every other optional attribute.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
misc/ss.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/misc/ss.c b/misc/ss.c
index 6ca6d406..0b7ba256 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -4773,10 +4773,6 @@ static int packet_show_sock(struct nlmsghdr *nlh, void *arg)
parse_rtattr(tb, PACKET_DIAG_MAX, (struct rtattr *)(r+1),
nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*r)));
- /* use /proc/net/packet if all info are not available */
- if (!tb[PACKET_DIAG_MEMINFO])
- return -1;
-
stat.type = r->pdiag_type;
stat.prot = r->pdiag_num;
stat.ino = r->pdiag_ino;
--
2.53.0
next prev parent reply other threads:[~2026-09-15 21:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 3:56 [PATCH iproute2 v2] ss: drop the /proc parsers for packet and netlink sockets Prabhakar Pujeri
2026-09-15 21:34 ` Stephen Hemminger
2026-09-15 21:36 ` [RFC PATCH iproute2 0/3] ss: follow-ups to the packet/netlink /proc removal Stephen Hemminger
2026-09-15 21:36 ` Stephen Hemminger [this message]
2026-09-15 21:36 ` [RFC 2/3] ss: warn when packet socket diag is unavailable Stephen Hemminger
2026-09-15 21:36 ` [RFC 3/3] ss: restore packet_raw/packet_dgram filtering 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=20260915213646.116214-2-stephen@networkplumber.org \
--to=stephen@networkplumber.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 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.