Skip to content

Commit c4a0b2d

Browse files
Low-powerBernd Eckenfels
authored andcommitted
netstat: port numbers in /proc/net/ipx/socket are in host byte order
1 parent 139f5d8 commit c4a0b2d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

netstat.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,8 +1763,7 @@ static int ipx_info(void)
17631763
sad, dad, &txq, &rxq, &state, &uid);
17641764
if ((st = rindex(sad, ':'))) {
17651765
*st++ = '\0';
1766-
sscanf(st, "%X", &sport); /* net byt order */
1767-
sport = ntohs(sport);
1766+
sscanf(st, "%X", &sport);
17681767
} else {
17691768
EINTERN("netstat.c", "ipx socket format error in source port");
17701769
fclose(f);
@@ -1774,8 +1773,7 @@ static int ipx_info(void)
17741773
if (strcmp(dad, "Not_Connected") != 0) {
17751774
if ((st = rindex(dad, ':'))) {
17761775
*st++ = '\0';
1777-
sscanf(st, "%X", &dport); /* net byt order */
1778-
dport = ntohs(dport);
1776+
sscanf(st, "%X", &dport);
17791777
} else {
17801778
EINTERN("netstat.c", "ipx socket format error in destination port");
17811779
fclose(f);

0 commit comments

Comments
 (0)