Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Qingfang Deng
Tue, 01 Dec 2026 04:00
[PATCH net-next] pppoe: make the session ID byte order explicit in procfs
Author: Qingfang Deng
Date: Tue, 01 Dec 2026 04:00
Date: Tue, 01 Dec 2026 04:00
32 lines
8894 bytes
8894 bytes
/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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads