From: Filippo Storniolo <fstornio@redhat.com>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
Robin van der Gracht <robin@protonic.nl>,
Oleksij Rempel <o.rempel@pengutronix.de>,
kernel@pengutronix.de,
Urs Thuermann <urs.thuermann@volkswagen.de>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
linux-can@vger.kernel.org, Davide Caratti <dcaratti@redhat.com>
Subject: Re: [PATCH can-next v3 0/3] Introduce diag support for CAN
Date: Wed, 21 Oct 2026 18:34:53 +0200 [thread overview]
Message-ID: <atjoNSuko42e4sF7@storniolo-redhat> (raw)
In-Reply-To: <f57ebd74-4a96-4954-bf03-b54f2a46ecdd@hartkopp.net>
On Wed, Oct 21, 2026 at 10:35:31AM +0200, Oliver Hartkopp wrote:
>
>The example does not solve the question about the port number having
>only 16 bit.
>
Davide says:
Actually in ss, the port values (lport and rport in struct sockstat
in ss.c) are int.
Moreover, the port field in ss is been used even for things that
do not represent a "port".
For example:
ss --packet -n
Netid Recv-Q Send-Q Local Address:Port Peer Address:Port
p_dgr 0 0 [35085]:wlp0s20f3 *
p_dgr 0 0 [34958]:* *
p_dgr 0 0 [2054]:wlp0s20f3 *
when requesting AF_PACKET diag, the Address columnn contains the
protocol passed through socket(AF_PACKET, ..., protocol):
- 2054 -> 0x806 -> arp
- 34958 -> 0x888e -> pae
while port column contains the ifnameindex.
>If someone uses 'ss' as you propose will there be a specific support
>for CAN?
>
At the moment it does not exist but in the future we might have.
Normally, when somebody adds a diag module they follow up with
the a patch for iproute2 (therefore: me).
>And what happens to older 'ss' binaries when used together
>with the CAN diag support?
>
Nothing. Old binaries won't support it because they won't require
AF_CAN inside sdiag_family in the netlink request message.
The use of the couple Address/Port in ss as far as I see is arbitrary
and for this reason I think it can still offer a bit of support
when asked to show open CAN sockets in the kernel.
And in worse case scenario, it would still be possible to write
from scratch a userspace program that uses CAN diag and show
open CAN socket stats in a better fashion.
Best regards,
Filippo
prev parent reply other threads:[~2026-10-21 16:35 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 14:12 [PATCH can-next v3 0/3] Introduce diag support for CAN Filippo Storniolo
2026-09-04 14:12 ` [PATCH can-next v3 1/3] af_can: ensure sk_protocol is always set on socket creation Filippo Storniolo
2026-10-20 15:26 ` Marc Kleine-Budde
2026-09-04 14:12 ` [PATCH can-next v3 2/3] af_can: store socket pointers in struct netns_can Filippo Storniolo
2026-09-04 14:12 ` [PATCH can-next v3 3/3] can: add can diag interface Filippo Storniolo
2026-09-04 14:26 ` sashiko-bot
2026-10-16 16:00 ` Filippo Storniolo
2026-10-17 10:10 ` Marc Kleine-Budde
2026-10-19 20:45 ` Jakub Kicinski
2026-10-20 12:27 ` Marc Kleine-Budde
2026-10-20 16:33 ` Filippo Storniolo
2026-10-21 9:11 ` Marc Kleine-Budde
2026-10-20 15:50 ` [PATCH can-next v3 0/3] Introduce diag support for CAN Marc Kleine-Budde
2026-10-20 16:20 ` Oliver Hartkopp
2026-10-21 7:37 ` Marc Kleine-Budde
2026-10-21 8:26 ` Filippo Storniolo
2026-10-21 8:35 ` Oliver Hartkopp
2026-10-21 16:34 ` Filippo Storniolo [this message]
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=atjoNSuko42e4sF7@storniolo-redhat \
--to=fstornio@redhat.com \
--cc=dcaratti@redhat.com \
--cc=horms@kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=o.rempel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=robin@protonic.nl \
--cc=socketcan@hartkopp.net \
--cc=urs.thuermann@volkswagen.de \
/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