Page MenuHomeFreeBSD

net-mgmt/net-snmp: fix build on FreeBSD 15.0-ALPHA1+
ClosedPublic

Authored by rikka.goering_outlook.de on Sep 8 2025, 5:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 12, 8:06 PM
Unknown Object (File)
Sat, Oct 11, 11:17 PM
Unknown Object (File)
Sat, Oct 11, 11:17 PM
Unknown Object (File)
Sat, Oct 11, 1:59 PM
Unknown Object (File)
Sat, Oct 11, 1:59 PM
Unknown Object (File)
Sat, Oct 11, 1:59 PM
Unknown Object (File)
Sat, Oct 11, 1:59 PM
Unknown Object (File)
Sat, Oct 11, 5:41 AM
Subscribers

Details

Summary

FreeBSD 15.0-ALPHA1+ exposes TCP pcblist entries as struct xtcpcb, where t_state
resides. Net-SNMP's tcpTable.c still treated entries as struct xinpcb, causing
compile errors (no member t_state / xt_inp path mismatch).

This change:

  • Includes <sys/param.h>, <netinet/tcp_var.h>, <netinet/in_pcb.h> on FreeBSD.
  • Sets NS_ELEM to struct xtcpcb on __FreeBSD_version >= 1500064.
  • Keeps the old xinpcb path on older systems.

No functional change expected on 14.x; fixes build on 15.0-ALPHA1+.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289351

Test Plan
  • Build on 14.3-RELEASE: OK (no change).
  • Requesting confirmation build on 15.0-ALPHA1/HEAD.

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

net-mgmt/net-snmp: fix build on FreeBSD 15.0-ALPHA1+

rikka.goering_outlook.de retitled this revision from Updated to current working status to net-mgmt/net-snmp: fix build on FreeBSD 15.0-ALPHA1+.Sep 8 2025, 5:47 PM
rikka.goering_outlook.de edited the summary of this revision. (Show Details)
rikka.goering_outlook.de edited the test plan for this revision. (Show Details)
rikka.goering_outlook.de added subscribers: eduardo, zi.
rikka.goering_outlook.de edited the summary of this revision. (Show Details)
  • Added missing include <sys/socketvar.h>
  • Ensured correct include order
  • Corrected formatting

I’ve added glebius@ as a reviewer since this breakage originates from src commit c62ae124cc78, which moved t_state into struct xtcpcb and guarded its declaration. Since they authored that change, it seemed appropriate to get confirmation that using xtcpcb is indeed the correct long-term interface for userland consumers like net-snmp.

This revision now requires changes to proceed.Sep 9 2025, 8:56 PM
  • include/net-snmp/system/freebsd16.h (includes freebsd15.h) and defines freebsd15 for compatibility checks.
  • Install the new header (Makefile.in + pkg-plist).

Mirrors 03e9f0cdfac68b11552c62cac1eaa27690fc0d32 (freebsd15.h) for 16. No functional agent changes.

Thanks Gleb - understood. My first attempt went the wrong way by touching tcpTable.c. I’ve now reworked the patch to follow commit 03e9f0cdfac68b11552c62cac1eaa27690fc0d32, adding freebsd16.h and updating the build/install list so 16 picks up the same path as 15. No other functional changes.

Updated patch posted, following Gleb’s suggestion; confirmed working by Cy on 16. Ready for review.

rikka.goering_outlook.de edited subscribers, added: glebius; removed: zi.

LGTM as it follows past patch procedures. Lets unbreak build.

This revision is now accepted and ready to land.Sep 10 2025, 5:09 PM
This revision was automatically updated to reflect the committed changes.

The patch has been merged upstream to master and is expected to ship in the next release (likely 5.10 or 6.1).