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
Unknown Object (File)
Wed, Dec 10, 9:22 AM
Unknown Object (File)
Fri, Nov 28, 10:46 PM
Unknown Object (File)
Fri, Nov 28, 12:40 PM
Unknown Object (File)
Wed, Nov 19, 4:41 AM
Unknown Object (File)
Nov 11 2025, 7:47 PM
Unknown Object (File)
Nov 8 2025, 2:35 PM
Unknown Object (File)
Nov 3 2025, 1:30 AM
Unknown Object (File)
Oct 29 2025, 11:54 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