From: Roy Marples Date: Thu, 13 Feb 2014 13:23:43 +0000 (+0000) Subject: Fix FreeBSD compile warnings. X-Git-Tag: v6.3.0~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0d033d1791cc22dfd674e83bc7dce3b26f3246ab;p=thirdparty%2Fdhcpcd.git Fix FreeBSD compile warnings. --- diff --git a/dhcpcd.c b/dhcpcd.c index 714974c2..34251c58 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -27,6 +27,8 @@ const char dhcpcd_copyright[] = "Copyright (c) 2006-2014 Roy Marples"; +#define _WITH_DPRINTF /* Stop FreeBSD bitching */ + #include #include #include diff --git a/if-bsd.c b/if-bsd.c index c1102823..076be3b4 100644 --- a/if-bsd.c +++ b/if-bsd.c @@ -122,6 +122,7 @@ open_link_socket(void) close(s); return -1; } + return s; #endif } diff --git a/if-options.c b/if-options.c index 2e0f2eeb..6e59c72b 100644 --- a/if-options.c +++ b/if-options.c @@ -25,6 +25,8 @@ * SUCH DAMAGE. */ +#define _WITH_GETLINE /* Stop FreeBSD bitching */ + #include #include #include diff --git a/ipv6.h b/ipv6.h index 5089d644..d0b8002c 100644 --- a/ipv6.h +++ b/ipv6.h @@ -154,7 +154,10 @@ struct ipv6_ctx { int nd_fd; #ifdef IPV6_SEND_DAD - int unspec_fd = -1; + int unspec_fd; +#endif +#ifdef LISTEN_DAD + uint8_t dad_warned; #endif struct ra_head *ra_routers; struct rt6_head *routes; diff --git a/ipv6nd.c b/ipv6nd.c index 2bcb701d..2e8a4e93 100644 --- a/ipv6nd.c +++ b/ipv6nd.c @@ -268,9 +268,13 @@ unspec: #endif #ifdef LISTEN_DAD - syslog(LOG_WARNING, "kernel does not report DAD results to userland"); - syslog(LOG_WARNING, - "warning listening to duplicated addresses on the wire"); + if (!ctx->dad_warned) { + syslog(LOG_WARNING, + "kernel does not report DAD results to userland"); + syslog(LOG_WARNING, + "warning listening to duplicated addresses on the wire"); + ctx->dad_warned = 1; + } #endif return ctx->nd_fd;