]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix FreeBSD compile warnings.
authorRoy Marples <roy@marples.name>
Thu, 13 Feb 2014 13:23:43 +0000 (13:23 +0000)
committerRoy Marples <roy@marples.name>
Thu, 13 Feb 2014 13:23:43 +0000 (13:23 +0000)
dhcpcd.c
if-bsd.c
if-options.c
ipv6.h
ipv6nd.c

index 714974c281aba32da09c529eadac1f7d661ba9d0..34251c5888b001dec7ab6b49f59d007a54e4585e 100644 (file)
--- 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 <sys/file.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
index c1102823b0cc863b06b898d690b2cb174fd2a6bf..076be3b4589cb74331fcb906a8837685ce0ebcef 100644 (file)
--- a/if-bsd.c
+++ b/if-bsd.c
@@ -122,6 +122,7 @@ open_link_socket(void)
                close(s);
                return -1;
        }
+       return s;
 #endif
 }
 
index 2e0f2eeb030978576511d0d311a99f4e6b2c6e38..6e59c72bbbf18fb71dd1288f66a949ac2b7d46fd 100644 (file)
@@ -25,6 +25,8 @@
  * SUCH DAMAGE.
  */
 
+#define _WITH_GETLINE /* Stop FreeBSD bitching */
+
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/queue.h>
diff --git a/ipv6.h b/ipv6.h
index 5089d644b32b8226c324cc55efc18b1c83227064..d0b8002c4a3758959b6d7e83d80bac42d948013c 100644 (file)
--- 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;
index 2bcb701d8437ecaf899a6ce5e81d1f0c690bad68..2e8a4e9340569a6f4895b4a0dfb56eac0605383b 100644 (file)
--- 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;