* [PATCH net-next] pppoe: make the session ID byte order explicit in procfs
@ 2026-12-01 4:00 Qingfang Deng
0 siblings, 0 replies; only message in thread
From: Qingfang Deng @ 2026-12-01 4:00 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Qingfang Deng, Simon Horman, Eric Woudstra,
Asim Viladi Oglu Manizada, Felix Fietkau, netdev
/proc/net/pppoe prints the network-order session ID as a native-endian
integer. A session ID of 0x1234 therefore appears as 00003412 on
little-endian hosts and 00001234 on big-endian hosts.
Explicitly cast the ID to u16 to document this ABI, so a static analysis
tool won't trip on it. Converting it to host byte order would change
what little-endian userspace reads.
Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
---
drivers/net/ppp/pppoe.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
index de6edc31790f..4b839f1d10aa 100644
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -929,8 +929,9 @@ static int pppoe_seq_show(struct seq_file *seq, void *v)
po = v;
dev_name = po->pppoe_pa.dev;
- seq_printf(seq, "%08X %pM %8s\n",
- po->pppoe_pa.sid, po->pppoe_pa.remote, dev_name);
+ /* The procfs ABI treats the network-order SID as a native u16. */
+ seq_printf(seq, "%08X %pM %8s\n", (__force u16)po->pppoe_pa.sid,
+ po->pppoe_pa.remote, dev_name);
out:
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-01 4:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 4:00 [PATCH net-next] pppoe: make the session ID byte order explicit in procfs Qingfang Deng
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.