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
F148037178: D39493.id.diff
Sun, Mar 15, 8:14 AM
Unknown Object (File)
Thu, Mar 5, 4:20 PM
Unknown Object (File)
Fri, Feb 27, 6:49 PM
Unknown Object (File)
Thu, Feb 26, 7:22 PM
Unknown Object (File)
Sat, Feb 21, 4:49 AM
Unknown Object (File)
Jan 29 2026, 4:40 PM
Unknown Object (File)
Jan 16 2026, 12:57 PM
Unknown Object (File)
Jan 16 2026, 4:36 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