From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 13:34:28 2013 Return-Path: Delivered-To: svn-src-all@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 E4A43515; Tue, 10 Dec 2013 13:34:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D190F1CA9; Tue, 10 Dec 2013 13:34:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBADYSCD052736; Tue, 10 Dec 2013 13:34:28 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBADYSlS052735; Tue, 10 Dec 2013 13:34:28 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312101334.rBADYSlS052735@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 10 Dec 2013 13:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259171 - head/usr.sbin/ndp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 13:34:29 -0000 Author: ae Date: Tue Dec 10 13:34:28 2013 New Revision: 259171 URL: http://svnweb.freebsd.org/changeset/base/259171 Log: Remove unused macro ADVANCE() and replace ROUNDUP() macro with ALIGN(). They aren't the same, but in our use cases ALIGN gives the same results. Modified: head/usr.sbin/ndp/ndp.c Modified: head/usr.sbin/ndp/ndp.c ============================================================================== --- head/usr.sbin/ndp/ndp.c Tue Dec 10 13:33:56 2013 (r259170) +++ head/usr.sbin/ndp/ndp.c Tue Dec 10 13:34:28 2013 (r259171) @@ -109,11 +109,6 @@ #include #include "gmt2local.h" -/* packing rule for routing socket */ -#define ROUNDUP(a) \ - ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) -#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len)) - #define NEXTADDR(w, s) \ if (rtm->rtm_addrs & (w)) { \ bcopy((char *)&s, cp, sizeof(s)); cp += SA_SIZE(&s);} @@ -421,7 +416,7 @@ set(int argc, char **argv) /* NOTREACHED */ } sin = (struct sockaddr_in6 *)(rtm + 1); - sdl = (struct sockaddr_dl *)(ROUNDUP(sin->sin6_len) + (char *)sin); + sdl = (struct sockaddr_dl *)(ALIGN(sin->sin6_len) + (char *)sin); if (IN6_ARE_ADDR_EQUAL(&sin->sin6_addr, &sin_m.sin6_addr)) { if (sdl->sdl_family == AF_LINK && !(rtm->rtm_flags & RTF_GATEWAY)) { @@ -508,7 +503,7 @@ delete(char *host) /* NOTREACHED */ } sin = (struct sockaddr_in6 *)(rtm + 1); - sdl = (struct sockaddr_dl *)(ROUNDUP(sin->sin6_len) + (char *)sin); + sdl = (struct sockaddr_dl *)(ALIGN(sin->sin6_len) + (char *)sin); if (IN6_ARE_ADDR_EQUAL(&sin->sin6_addr, &sin_m.sin6_addr)) { if (sdl->sdl_family == AF_LINK && !(rtm->rtm_flags & RTF_GATEWAY)) { @@ -598,7 +593,7 @@ again:; rtm = (struct rt_msghdr *)next; sin = (struct sockaddr_in6 *)(rtm + 1); - sdl = (struct sockaddr_dl *)((char *)sin + ROUNDUP(sin->sin6_len)); + sdl = (struct sockaddr_dl *)((char *)sin + ALIGN(sin->sin6_len)); /* * Some OSes can produce a route that has the LINK flag but