Page MenuHomeFreeBSD

netinet: Promote IFP_TO_IA() from macro to function in_ifprimaryaddr().
AcceptedPublic

Authored by bms on Wed, Feb 18, 10:39 AM.
Tags
None
Referenced Files
F145502342: D55344.diff
Fri, Feb 20, 4:10 PM
F145502338: D55344.diff
Fri, Feb 20, 4:10 PM
Unknown Object (File)
Thu, Feb 19, 12:29 AM
Unknown Object (File)
Wed, Feb 18, 11:14 PM
Subscribers

Details

Reviewers
glebius
imp
bz
pouria
Group Reviewers
network
Summary

in_primaryaddr() exists only to support IPv4 multicast usage. Since the
adoption of epoch tracking, ifa_ref() is no longer required in its body.

Add a comment that IFP_TO_IA() is now deprecated. We cannot use
__deprecated1() from <sys/cdefs.h> as it is a macro, and not a function.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 70788
Build 67671: arc lint + arc unit

Event Timeline

bms requested review of this revision.Wed, Feb 18, 10:39 AM
This revision is now accepted and ready to land.Wed, Feb 18, 11:16 AM
sys/netinet/in.c
300

Since it operates in the scope of a single interface, let's name it with in_ifnet_ prefix, to match existing in_ifnet_broadcast and separate from other primitives that operator on global scope. Possible names are: in_ifnet_firstaddr, in_ifnet_primaryaddr, in_ifnet_primary.

302–311

Let's iterate over this interface address list instead of global list. Should be better for a host with many interfaces and addresses. This also will make the function not requiring VNET context to be set.

sys/netinet/in_var.h
155–167

Let's just remove it completely. There is no out of tree code that uses it. If there existed any, it would be broken numerous times, most recently with the epoch changes.

sys/netinet/in_var.h
155–167

Let's just remove it completely. There is no out of tree code that uses it. If there existed any, it would be broken numerous times, most recently with the epoch changes.

+1
I think this should be done in D55345.

This revision now requires review to proceed.Thu, Feb 19, 5:27 PM
bms retitled this revision from netinet: Promote IFP_TO_IA() from macro to function in_primaryaddr(). to netinet: Promote IFP_TO_IA() from macro to function in_ifprimaryaddr()..Thu, Feb 19, 5:35 PM

Something smells off to me about in_ifprimaryaddr(), like not pre-emptively setting ifa to NULL. Sorry, distracted with all this git and git arc nonsense.

This revision is now accepted and ready to land.Thu, Feb 19, 9:20 PM