From: Roy Marples Date: Thu, 20 Mar 2008 17:03:55 +0000 (+0000) Subject: Fix compile on NetBSD X-Git-Tag: v4.0.2~540 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=daee47fc1d49cda866ed641bc516c627be75fc6d;p=thirdparty%2Fdhcpcd.git Fix compile on NetBSD --- diff --git a/configure.c b/configure.c index 5673f566..6cc14bca 100644 --- a/configure.c +++ b/configure.c @@ -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 23023d03..cf7baafa 100644 --- 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 855b72df..c7554424 100644 --- 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", diff --git a/interface.c b/interface.c index 82633a8e..7ad51d35 100644 --- a/interface.c +++ b/interface.c @@ -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; diff --git a/interface.h b/interface.h index a9991273..76be7c39 100644 --- a/interface.h +++ b/interface.h @@ -92,14 +92,14 @@ #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 { diff --git a/socket.c b/socket.c index 08db6095..a894c9f1 100644 --- 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;