Page MenuHomeFreeBSD

IfAPI: Add if_maddr_empty() to check for any maddrs
ClosedPublic

Authored by jhibbits on Apr 10 2023, 7:14 PM.
Tags
None
Referenced Files
F132354794: D39493.id.diff
Thu, Oct 16, 4:38 AM
Unknown Object (File)
Wed, Oct 15, 6:57 AM
Unknown Object (File)
Wed, Oct 15, 6:57 AM
Unknown Object (File)
Wed, Oct 15, 6:57 AM
Unknown Object (File)
Tue, Oct 14, 8:54 PM
Unknown Object (File)
Tue, Oct 14, 8:31 AM
Unknown Object (File)
Tue, Oct 14, 3:30 AM
Unknown Object (File)
Sat, Oct 11, 7:42 AM

Details

Summary

if_llmaddr_count() only counts link-level multicast addresses.
hv_netvsc(4) needs to know if there are any multicast addresses. Since
hv_netvsc(4) is the only instance where this would be used, make it a
simple boolean. If others need a if_maddr_count(), that can be added in
the future.

Diff Detail

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

Event Timeline

Ping? Would a simple boolean be better than a count?

Ping? Would a simple boolean be better than a count?

grep the code it seems hv_netvsc(4) is the only consumer of this, and it is used in the slow path (configuration). Then the boolean one will be much simpler and straight.

I do not have strong options. Either a count or boolean is OK.

CC @glebius if he has some thought about this.

sys/net/if_var.h
660
jhibbits retitled this revision from IfAPI: Add if_maddr_count() to count all multicast addresses to IfAPI: Add if_maddr_empty() to check for any maddrs.
jhibbits edited the summary of this revision. (Show Details)

Switch to a boolean, if_maddr_empty() instead.

This revision is now accepted and ready to land.May 2 2023, 3:53 PM