Date: Sun, 18 Jul 2021 00:36:26 GMT From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 9af6ce636839 - stable/13 - LinuxKPI: add ether_addr_equal_unaligned() Message-ID: <202107180036.16I0aQDB049132@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9af6ce636839faecaf2d6357370f8fc811c94775 commit 9af6ce636839faecaf2d6357370f8fc811c94775 Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2021-05-24 18:09:37 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2021-07-18 00:35:01 +0000 LinuxKPI: add ether_addr_equal_unaligned() Replace the implementation for ether_addr_equal() with ether_addr_equal_unaligned() and add a define for ether_addr_equal() pointing to the now ether_addr_equal_unaligned() implementation. This way ether_addr_equal_unaligned() cannot be broken by accident [1]. Suggested by: emaste [1] Sponsored by: The FreeBSD Foundation Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D30425 (cherry picked from commit 834227ba6e80dc0899d2372ae8986241f5658c4e) --- sys/compat/linuxkpi/common/include/linux/etherdevice.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/etherdevice.h b/sys/compat/linuxkpi/common/include/linux/etherdevice.h index 392f395a5feb..9062cd562347 100644 --- a/sys/compat/linuxkpi/common/include/linux/etherdevice.h +++ b/sys/compat/linuxkpi/common/include/linux/etherdevice.h @@ -82,10 +82,11 @@ ether_addr_copy(u8 * dst, const u8 * src) } static inline bool -ether_addr_equal(const u8 *pa, const u8 *pb) +ether_addr_equal_unaligned(const u8 *pa, const u8 *pb) { return (memcmp(pa, pb, 6) == 0); } +#define ether_addr_equal(_pa, _pb) ether_addr_equal_unaligned(_pa, _pb) static inline bool ether_addr_equal_64bits(const u8 *pa, const u8 *pb)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107180036.16I0aQDB049132>