]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Use RT_ROUNDUP and friends so that we work with NetBSD 64-bit routing.
authorRoy Marples <roy@marples.name>
Fri, 4 Feb 2011 14:43:51 +0000 (14:43 +0000)
committerRoy Marples <roy@marples.name>
Fri, 4 Feb 2011 14:43:51 +0000 (14:43 +0000)
if-bsd.c

index 462ec2a0a09166a0414b0d23c422306de7f5b980..49fc7c27b5ea56b38a69d4bb75da54aff0a5ae08 100644 (file)
--- a/if-bsd.c
+++ b/if-bsd.c
 #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;
        }