Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

be2net: Use correct byte order and format string for TCP seq and ack_seq

The TCP header fields seq and ack_seq are 32-bit values in network
byte order as (__be32). these fields were earlier printed using
ntohs(), which converts only 16-bit values and produces incorrect
results for 32-bit fields. This patch is changeing the conversion
to ntohl(), ensuring correct interpretation of these sequence numbers.

Notably, the format specifier is updated from %d to %u to reflect the
unsigned nature of these fields.

improves the accuracy of debug log messages for TCP sequence and
acknowledgment numbers during TX timeouts.

Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250717193552.3648791-1-alok.a.tiwari@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Alok Tiwari and committed by
Jakub Kicinski
4701ee50 190ccb81

+4 -4
+4 -4
drivers/net/ethernet/emulex/benet/be_main.c
··· 1465 1465 ntohs(tcphdr->source)); 1466 1466 dev_info(dev, "TCP dest port %d\n", 1467 1467 ntohs(tcphdr->dest)); 1468 - dev_info(dev, "TCP sequence num %d\n", 1469 - ntohs(tcphdr->seq)); 1470 - dev_info(dev, "TCP ack_seq %d\n", 1471 - ntohs(tcphdr->ack_seq)); 1468 + dev_info(dev, "TCP sequence num %u\n", 1469 + ntohl(tcphdr->seq)); 1470 + dev_info(dev, "TCP ack_seq %u\n", 1471 + ntohl(tcphdr->ack_seq)); 1472 1472 } else if (ip_hdr(skb)->protocol == 1473 1473 IPPROTO_UDP) { 1474 1474 udphdr = udp_hdr(skb);