Page MenuHomeFreeBSD

netinet6: factor interface addition code to the dedicated function
ClosedPublic

Authored by melifaro on Sep 26 2022, 1:51 PM.
Tags
None
Referenced Files
F82659554: D36713.id.diff
Wed, May 1, 7:21 AM
Unknown Object (File)
Sat, Apr 27, 1:14 PM
Unknown Object (File)
Sat, Apr 27, 1:10 PM
Unknown Object (File)
Sat, Apr 27, 1:10 PM
Unknown Object (File)
Sat, Apr 27, 12:04 PM
Unknown Object (File)
Sat, Apr 20, 5:22 AM
Unknown Object (File)
Sun, Apr 7, 6:46 PM
Unknown Object (File)
Feb 24 2024, 2:02 AM
Subscribers

Details

Summary

Move SIOCAIFADDR_IN6 (current "primary" ioctl to add an IPv6 interface address) handling code to the dedicated in6_addifaddr() function and make it a part of KPI. This allows in-kernel users to add/delete interfaces addresses without relying on ioctl interface.

Note: the code in the function is a full copy-paste, except 2 places:

  • the first difference is "compat" handling for CARP - instead of comparing the CMDs, the ioctl handler now zeroes vhid value so the carp check always fails for compat cmd.
  • the second is the return in the furst in6ifa_ifpwithaddr() check - as ia is NULL, it is possible to simply return with success.

The function by itself consumes passed ia.

Diff Detail

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