Skip to content

Commit 4701ee5

Browse files
aloktiwakuba-moo
authored andcommitted
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 <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 190ccb8 commit 4701ee5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/ethernet/emulex/benet/be_main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,10 +1465,10 @@ static void be_tx_timeout(struct net_device *netdev, unsigned int txqueue)
14651465
ntohs(tcphdr->source));
14661466
dev_info(dev, "TCP dest port %d\n",
14671467
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));
14721472
} else if (ip_hdr(skb)->protocol ==
14731473
IPPROTO_UDP) {
14741474
udphdr = udp_hdr(skb);

0 commit comments

Comments
 (0)