Page MenuHomeFreeBSD

sockstat: change check for wildcard sockets to avoid historical classes
ClosedPublic

Authored by karels on Oct 28 2021, 4:55 PM.
Tags
None
Referenced Files
F107365739: D32715.diff
Mon, Jan 13, 2:52 AM
F107330286: D32715.id98252.diff
Sun, Jan 12, 2:20 PM
Unknown Object (File)
Wed, Dec 25, 9:27 AM
Unknown Object (File)
Tue, Dec 24, 8:18 PM
Unknown Object (File)
Dec 10 2024, 6:05 PM
Unknown Object (File)
Nov 28 2024, 7:28 AM
Unknown Object (File)
Nov 24 2024, 3:24 PM
Unknown Object (File)
Nov 10 2024, 5:39 PM
Subscribers

Details

Summary

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.

Test Plan

tested on system with numerous servers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 42420
Build 39308: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Oct 28 2021, 9:54 PM
usr.bin/sockstat/sockstat.c
877

Don't you need here (conceptually) htonl(INADDR_ANY)?

usr.bin/sockstat/sockstat.c
877

Conceptually, yes. I see several other instances of comparisons of in_addr's to INADDR_ANY in netstat and others; I had probably just looked at that. I could change it if you prefer; it's not a performance issue.