in6: Consolidate IN6_ARE_ADDR_EQUAL definitions

It is ok to use memcmp() in the kernel.  No functional change intended.

Reviewed by:	glebius, melifaro
MFC after:	1 week
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37028
This commit is contained in:
Mark Johnston 2022-11-02 13:06:54 -04:00
parent a152dd8634
commit 0d5d356b36

View File

@ -219,19 +219,11 @@ extern const struct in6_addr in6addr_linklocal_allv2routers;
/*
* Equality
* NOTE: Some of kernel programming environment (for example, openbsd/sparc)
* does not supply memcmp(). For userland memcmp() is preferred as it is
* in ANSI standard.
*/
#ifdef _KERNEL
#define IN6_ARE_ADDR_EQUAL(a, b) \
(bcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0)
#else
#if __BSD_VISIBLE
#define IN6_ARE_ADDR_EQUAL(a, b) \
(memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0)
#endif
#endif
/*
* Unspecified