Page MenuHomeFreeBSD

LinuxKPI: add ether_addr_equal_unaligned()
ClosedPublic

Authored by bz on May 24 2021, 6:23 PM.

Details

Summary

Add a #define for ether_addr_equal_unaligned() founf in wireless
drivers. ether_addr_equal() already uses memcmp() so we should be
fine for unaligned accessed.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by:
Differential Revision:

Diff Detail

Repository
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

bz requested review of this revision.May 24 2021, 6:23 PM

founf -> found

Should we do this the other way, making ether_addr_equal_unaligned the inline fn and ether_addr_equal a #define, so that ether_addr_equal can't be accidentally broken?

hselasky added inline comments.
sys/compat/linuxkpi/common/include/linux/etherdevice.h
88

Too many parenthesis (not needed here)!
((_pa), (_pb)) -> (_pa, _pb)

Switch the implementation and define as suggested by @emaste.
Revmove extra () as pointed out by @hselasky.

bz marked an inline comment as done.May 24 2021, 9:39 PM
This revision is now accepted and ready to land.May 25 2021, 7:39 AM
This revision was automatically updated to reflect the committed changes.