]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix compile on NetBSD
authorRoy Marples <roy@marples.name>
Thu, 20 Mar 2008 17:03:55 +0000 (17:03 +0000)
committerRoy Marples <roy@marples.name>
Thu, 20 Mar 2008 17:03:55 +0000 (17:03 +0000)
configure.c
dhcp.c
info.c
interface.c
interface.h
socket.c

index 5673f5668b1d3b97beaea88ff42c20d7c6fd3cf6..6cc14bca56cac89b63500b3ba57e8ed56fa08859 100644 (file)
@@ -253,9 +253,9 @@ in_addresses(const struct address_head *addresses, struct in_addr address)
 }
 
 static bool
-in_routes(const struct route_head *routes, struct route *route)
+in_routes(const struct route_head *routes, struct rt *route)
 {
-       const struct route *r;
+       const struct rt *r;
 
        if (! routes)
                return false;
@@ -532,9 +532,9 @@ int
 configure (const struct options *options, struct interface *iface,
           const struct dhcp *dhcp, bool up)
 {
-       struct route *route = NULL;
+       struct rt *route = NULL;
        struct route_head *new_routes = NULL;
-       struct route *new_route = NULL;
+       struct rt *new_route = NULL;
        char *newhostname = NULL;
        char *curhostname = NULL;
        int remember;
@@ -680,8 +680,8 @@ configure (const struct options *options, struct interface *iface,
                                new_routes = xmalloc(sizeof(*new_routes));
                                STAILQ_INIT(new_routes);
                        }
-                       new_route = xmalloc(sizeof (struct route));
-                       memcpy(new_route, route, sizeof (*new_route));
+                       new_route = xmalloc(sizeof(*new_route));
+                       memcpy(new_route, route, sizeof(*new_route));
                        STAILQ_INSERT_TAIL(new_routes, new_route, entries);
                }
 #ifdef THERE_IS_NO_FORK
diff --git a/dhcp.c b/dhcp.c
index 23023d03a90ac2b7dfc78449f2c32a4e0a17565f..cf7baafa189317b972a5ed9322de8a13b8b96650 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -403,7 +403,7 @@ decode_CSR(const unsigned char *p, int len)
        unsigned int cidr;
        unsigned int ocets;
        struct route_head *routes = NULL;
-       struct route *route;
+       struct rt *route;
 
        /* Minimum is 5 -first is CIDR and a router length of 4 */
        if (len < 5)
@@ -579,7 +579,7 @@ decode_routes(const unsigned char *data, int length)
 {
        int i;
        struct route_head *head = NULL;
-       struct route *route;
+       struct rt *route;
        
        for (i = 0; i < length; i += 8) {
                if (! head) {
@@ -602,7 +602,7 @@ decode_routers(const unsigned char *data, int length)
 {
        int i;
        struct route_head *head = NULL;
-       struct route *route = NULL;
+       struct rt *route = NULL;
 
        for (i = 0; i < length; i += 4) {
                if (! head) {
diff --git a/info.c b/info.c
index 855b72df22b807fbd987811e72ce8e4ca895d3a8..c75544247375d121c0b3428f93b71bed5ed83d98 100644 (file)
--- a/info.c
+++ b/info.c
@@ -110,7 +110,7 @@ write_info(const struct interface *iface, const struct dhcp *dhcp,
           const struct options *options, bool overwrite)
 {
        FILE *f;
-       struct route *route;
+       struct rt *route;
        struct stat sb;
        struct in_addr addr;
        bool doneone;
@@ -324,7 +324,7 @@ read_info(const struct interface *iface, struct dhcp *dhcp)
        char *p;
        struct stat sb;
        char *pp, *dest, *net, *gate;
-       struct route *route;
+       struct rt *route;
 
        if (stat(iface->infofile, &sb) != 0) {
                logger(LOG_ERR, "lease information file `%s' does not exist",
index 82633a8eafeb1136e3ffc792244ccc9548177902..7ad51d35173d7f336833b4d60e41dfab7a449d4b 100644 (file)
@@ -81,8 +81,8 @@ free_address(struct address_head *addresses)
 void
 free_route(struct route_head *routes)
 {
-       struct route *p;
-       struct route *n;
+       struct rt *p;
+       struct rt *n;
 
        if (!routes)
                return;
index a999127342aed21697fbc28edc3b2d5092df1442..76be7c392c60e64c5f850162303dfa779b444223 100644 (file)
 #define NSTAILQ_FOREACH(var, head, field) \
                if (head) STAILQ_FOREACH (var, head, field)
 
-struct route
+struct rt
 {
        struct in_addr destination; 
        struct in_addr netmask;
        struct in_addr gateway;
-       STAILQ_ENTRY (route) entries;
+       STAILQ_ENTRY (rt) entries;
 };
-STAILQ_HEAD (route_head, route);
+STAILQ_HEAD (route_head, rt);
 
 struct address
 {
index 08db6095d49cecfcb5fe447578d04779fa0ed7ce..a894c9f1c3d0e6bc9abe019735142426c21e214c 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -384,7 +384,7 @@ get_packet(const struct interface *iface, unsigned char *data,
                struct udp_dhcp_packet *packet;
        } pay;
        struct timespec ts;
-       size_t len
+       size_t len;
        unsigned char *payload;
        bool have_data;