HomeFreeBSD

sockstat: fix port parsing after libxo integration

Description

sockstat: fix port parsing after libxo integration

parse_ports has been broken ever since 7b35b4d, and it's a sufficiently
complicated function that it really deserves some unit tests. Fix it,
and add tests. Refactor the code a little bit to facilitate unit tests.
Chiefly, split the tested functions out of main.c into sockstat.c .

PR: 288731
Fixes: 7b35b4d ("sockstat: add libxo support")
Sponsored by: ConnectWise
PR: https://github.com/freebsd/freebsd-src/pull/1807
Reviewed by: rido

Details

Provenance
asomersAuthored on Aug 12 2025, 4:26 PM
Parents
rGec92e61f99f6: sockstat: rename sockstat.c to main.c
Branches
Unknown
Tags
Unknown