From: Roy Marples Date: Fri, 4 Feb 2011 14:43:51 +0000 (+0000) Subject: Use RT_ROUNDUP and friends so that we work with NetBSD 64-bit routing. X-Git-Tag: v5.2.11~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b92c960fe0c7a0b3a1cd7f33699d7e1a4db1b518;p=thirdparty%2Fdhcpcd.git Use RT_ROUNDUP and friends so that we work with NetBSD 64-bit routing. --- diff --git a/if-bsd.c b/if-bsd.c index 462ec2a0..49fc7c27 100644 --- a/if-bsd.c +++ b/if-bsd.c @@ -61,9 +61,11 @@ #include "if-options.h" #include "net.h" -#define ROUNDUP(a) \ +#ifndef RT_ROUNDUP +#define RT_ROUNDUP(a) \ ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) -#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len)) +#define RT_ADVANCE(x, n) (x += RT_ROUNDUP((n)->sa_len)) +#endif /* FIXME: Why do we need to check for sa_family 255 */ #define COPYOUT(sin, sa) \ @@ -198,7 +200,7 @@ if_route(const struct interface *iface, const struct in_addr *dest, int retval = 0; #define ADDSU(_su) { \ - l = ROUNDUP(_su.sa.sa_len); \ + l = RT_ROUNDUP(_su.sa.sa_len); \ memcpy(bp, &(_su), l); \ bp += l; \ } @@ -298,7 +300,7 @@ get_addrs(int type, char *cp, struct sockaddr **sa) inet_ntoa(((struct sockaddr_in *)sa[i])-> sin_addr)); #endif - ADVANCE(cp, sa[i]); + RT_ADVANCE(cp, sa[i]); } else sa[i] = NULL; }