From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 16:13:12 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 610A43B9; Sat, 26 Apr 2014 16:13:12 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF19419D7; Sat, 26 Apr 2014 16:13:11 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=ptichko.yndx.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1We1KX-000PTq-3w; Sat, 26 Apr 2014 16:03:41 +0400 Message-ID: <535BDAFF.2020909@FreeBSD.org> Date: Sat, 26 Apr 2014 20:12:47 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r264973 - in head/sys: net netinet6 References: <201404261452.s3QEq48b086947@svn.freebsd.org> <1398528371.61646.147.camel@revolution.hippie.lan> In-Reply-To: <1398528371.61646.147.camel@revolution.hippie.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 16:13:12 -0000 On 26.04.2014 20:06, Ian Lepore wrote: > On Sat, 2014-04-26 at 14:52 +0000, Alexander V. Chernikov wrote: >> Author: melifaro >> Date: Sat Apr 26 14:52:03 2014 >> New Revision: 264973 >> URL: http://svnweb.freebsd.org/changeset/base/264973 >> >> Log: >> Unify sa_equal() macro usage. >> >> MFC after: 2 weeks >> >> Modified: >> head/sys/net/if.c >> head/sys/net/route.c >> head/sys/net/route.h >> head/sys/net/rtsock.c >> head/sys/netinet6/ip6_input.c >> > FYI, there's another #define sa_equal (and sa_dl_equal) in > usr.sbin/ifmcstat/ifmcstat.c, which is now getting a redefined error. Thanks, removed in r264974. > > -- Ian > >> Modified: head/sys/net/if.c >> ============================================================================== >> --- head/sys/net/if.c Sat Apr 26 14:39:58 2014 (r264972) >> +++ head/sys/net/if.c Sat Apr 26 14:52:03 2014 (r264973) >> @@ -1550,9 +1550,6 @@ ifa_switch_loopback_route(struct ifaddr >> * 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) && \ >> >> Modified: head/sys/net/route.c >> ============================================================================== >> --- head/sys/net/route.c Sat Apr 26 14:39:58 2014 (r264972) >> +++ head/sys/net/route.c Sat Apr 26 14:52:03 2014 (r264973) >> @@ -125,10 +125,6 @@ VNET_DEFINE(int, rttrash); /* routes no >> #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 >> >> Modified: head/sys/net/route.h >> ============================================================================== >> --- head/sys/net/route.h Sat Apr 26 14:39:58 2014 (r264972) >> +++ head/sys/net/route.h Sat Apr 26 14:52:03 2014 (r264973) >> @@ -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) \ >> >> Modified: head/sys/net/rtsock.c >> ============================================================================== >> --- head/sys/net/rtsock.c Sat Apr 26 14:39:58 2014 (r264972) >> +++ head/sys/net/rtsock.c Sat Apr 26 14:52:03 2014 (r264973) >> @@ -517,7 +517,6 @@ rtm_get_jailed(struct rt_addrinfo *info, >> 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 >> >> Modified: head/sys/netinet6/ip6_input.c >> ============================================================================== >> --- head/sys/netinet6/ip6_input.c Sat Apr 26 14:39:58 2014 (r264972) >> +++ head/sys/netinet6/ip6_input.c Sat Apr 26 14:52:03 2014 (r264973) >> @@ -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)) { >> > >