Page MenuHomeFreeBSD

kern: wg: refactor out some repetitive bits in allowed-ip config
ClosedPublic

Authored by kevans on May 21 2025, 4:00 AM.
Tags
None
Referenced Files
F164829205: D50446.id157635.diff
Tue, Aug 4, 6:00 AM
Unknown Object (File)
Mon, Jul 27, 5:28 PM
Unknown Object (File)
Tue, Jul 21, 10:46 AM
Unknown Object (File)
Mon, Jul 13, 12:33 PM
Unknown Object (File)
Sun, Jul 12, 12:39 AM
Unknown Object (File)
Mon, Jul 6, 3:32 AM
Unknown Object (File)
Jun 30 2026, 10:44 PM
Unknown Object (File)
Jun 24 2026, 1:03 AM
Subscribers

Details

Summary

The only difference in the wg_aip_add() call after IP validation is the
address family. Just pull that out into a variable and avoid the two
different callsites for wg_aip_add(). A future change will add a new
call for each case to remove an address from the peer, so it's nice to
avoid needing to repeat the logic for two different branches.

Diff Detail

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