summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ndp
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2013-12-10 13:34:28 +0000
committerae <ae@FreeBSD.org>2013-12-10 13:34:28 +0000
commit531c51f388ae302e37f8fb4b3d6d1338537d9257 (patch)
tree7ff601b44b4ae4e12e5ba1398407af7d02916989 /usr.sbin/ndp
parent8c2a73b68fa2825b4655be8f80c4b7ed50fe699b (diff)
downloadFreeBSD-src-531c51f388ae302e37f8fb4b3d6d1338537d9257.zip
FreeBSD-src-531c51f388ae302e37f8fb4b3d6d1338537d9257.tar.gz
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.
Diffstat (limited to 'usr.sbin/ndp')
-rw-r--r--usr.sbin/ndp/ndp.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c
index fe22347..2f9e2f6 100644
--- a/usr.sbin/ndp/ndp.c
+++ b/usr.sbin/ndp/ndp.c
@@ -109,11 +109,6 @@
#include <unistd.h>
#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
OpenPOWER on IntegriCloud