Unify sa_equal() macro usage.

MFC after:	2 weeks
This commit is contained in:
Alexander V. Chernikov 2014-04-26 14:52:03 +00:00
parent 11a4d354a2
commit 36d55f0f9d
5 changed files with 4 additions and 12 deletions

View File

@ -1550,9 +1550,6 @@ ifa_switch_loopback_route(struct ifaddr *ifa, struct sockaddr *sa, int fib)
* to perform a different comparison.
*/
#define sa_equal(a1, a2) \
(bcmp((a1), (a2), ((a1))->sa_len) == 0)
#define sa_dl_equal(a1, a2) \
((((struct sockaddr_dl *)(a1))->sdl_len == \
((struct sockaddr_dl *)(a2))->sdl_len) && \

View File

@ -125,10 +125,6 @@ VNET_DEFINE(int, rttrash); /* routes not in table but not freed */
#define V_rttrash VNET(rttrash)
/* compare two sockaddr structures */
#define sa_equal(a1, a2) (((a1)->sa_len == (a2)->sa_len) && \
(bcmp((a1), (a2), (a1)->sa_len) == 0))
/*
* Convert a 'struct radix_node *' to a 'struct rtentry *'.
* The operation can be done safely (in this code) because a

View File

@ -275,6 +275,10 @@ struct rt_addrinfo {
sizeof(long) : \
1 + ( (((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(long) - 1) ) )
#define sa_equal(a, b) ( \
(((struct sockaddr *)(a))->sa_len == ((struct sockaddr *)(b))->sa_len) && \
(bcmp((a), (b), ((struct sockaddr *)(b))->sa_len) == 0))
#ifdef _KERNEL
#define RT_LINK_IS_UP(ifp) (!((ifp)->if_capabilities & IFCAP_LINKSTATE) \

View File

@ -517,7 +517,6 @@ rtm_get_jailed(struct rt_addrinfo *info, struct ifnet *ifp,
static int
route_output(struct mbuf *m, struct socket *so)
{
#define sa_equal(a1, a2) (bcmp((a1), (a2), (a1)->sa_len) == 0)
struct rt_msghdr *rtm = NULL;
struct rtentry *rt = NULL;
struct radix_node_head *rnh;
@ -960,7 +959,6 @@ flush:
Free(rtm);
}
return (error);
#undef sa_equal
}
static void

View File

@ -695,8 +695,6 @@ passin:
int bad;
bad = 1;
#define sa_equal(a1, a2) \
(bcmp((a1), (a2), ((a1))->sin6_len) == 0)
IF_ADDR_RLOCK(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != dst6.sin6_family)
@ -706,7 +704,6 @@ passin:
}
KASSERT(ifa != NULL, ("%s: ifa not found for lle %p",
__func__, lle));
#undef sa_equal
ia6 = (struct in6_ifaddr *)ifa;
if (!(ia6->ia6_flags & IN6_IFF_NOTREADY)) {