Mercurial > hg > dhcpcd
changeset 1586:0b0524883d8a draft
Use RT_ROUNDUP and friends so that we work with NetBSD 64-bit routing.
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Fri, 04 Feb 2011 14:43:51 +0000 |
| parents | afde8eef904f |
| children | 73824a750a26 |
| files | if-bsd.c |
| diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/if-bsd.c Mon Jan 03 11:42:43 2011 +0000 +++ b/if-bsd.c Fri Feb 04 14:43:51 2011 +0000 @@ -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 @@ 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 @@ inet_ntoa(((struct sockaddr_in *)sa[i])-> sin_addr)); #endif - ADVANCE(cp, sa[i]); + RT_ADVANCE(cp, sa[i]); } else sa[i] = NULL; }
