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
Unknown Object (File)
Fri, Mar 20, 4:10 PM
Unknown Object (File)
Fri, Mar 20, 10:12 AM
Unknown Object (File)
Mon, Mar 16, 4:31 PM
Unknown Object (File)
Mon, Mar 16, 7:10 AM
Unknown Object (File)
Fri, Mar 13, 9:19 AM
Unknown Object (File)
Thu, Mar 12, 3:31 AM
Unknown Object (File)
Thu, Mar 5, 7:08 PM
Unknown Object (File)
Wed, Mar 4, 7:34 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