Page MenuHomeFreeBSD

Add more buffers for ndp in rtsock mode
ClosedPublic

Authored by lytboris_gmail.com on Feb 18 2024, 9:00 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 9 2024, 3:37 AM
Unknown Object (File)
Dec 3 2024, 3:28 PM
Unknown Object (File)
Nov 29 2024, 8:16 AM
Unknown Object (File)
Nov 24 2024, 11:19 PM
Unknown Object (File)
Nov 24 2024, 8:03 PM
Unknown Object (File)
Nov 23 2024, 8:57 PM
Unknown Object (File)
Nov 23 2024, 12:01 AM
Unknown Object (File)
Nov 21 2024, 4:45 AM
Subscribers

Details

Summary

On a router with ~10k+ connected devices ndp -an fails with ENOMEM because of some additional NDP records were added between sysctl() buffer size estimate and data fetch calls:

> ndp -an 
ndp: sysctl(PF_ROUTE, NET_RT_FLAGS): Cannot allocate memory

This patch allocates more space based on size estimate: 1/64 (~2%) of additional space, but not less that 4 m_rtmsg structures.

Test Plan

Run

while true; do ndp -an >/dev/null; done

on a router.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Feb 19 2024, 7:54 AM
This revision was automatically updated to reflect the committed changes.