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)
Sun, May 12, 6:20 PM
Unknown Object (File)
Sun, May 12, 6:20 PM
Unknown Object (File)
Sun, May 12, 6:20 PM
Unknown Object (File)
Sun, May 12, 6:15 PM
Unknown Object (File)
Thu, May 9, 7:34 PM
Unknown Object (File)
Fri, May 3, 9:26 AM
Unknown Object (File)
Sat, Apr 27, 5:47 AM
Unknown Object (File)
Apr 3 2024, 12:16 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