sockstat: change check for wildcard sockets to avoid historical classes
sockstat was checking whether a bound address was "host 0", the lowest host on a network, using inet_lnaof(). This only works for class A/B/C. However, it isn't useful to bind such an address unless it is really the unspecified address INADDR_ANY. Change the check to to use that. MFC after: 1 month Reviewd by: tuexen Differential Revision: https://reviews.freebsd.org/D32715
This commit is contained in:
parent
bd27c71c45
commit
64acb29b7d
@ -874,7 +874,7 @@ printaddr(struct sockaddr_storage *ss)
|
|||||||
|
|
||||||
switch (ss->ss_family) {
|
switch (ss->ss_family) {
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
if (inet_lnaof(sstosin(ss)->sin_addr) == INADDR_ANY)
|
if (sstosin(ss)->sin_addr.s_addr == INADDR_ANY)
|
||||||
addrstr[0] = '*';
|
addrstr[0] = '*';
|
||||||
port = ntohs(sstosin(ss)->sin_port);
|
port = ntohs(sstosin(ss)->sin_port);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user