odhcpd: fix compilation with GCC10 openwrt-19.07
authorRosen Penev <rosenp@gmail.com>
Mon, 22 Jun 2020 04:37:36 +0000 (21:37 -0700)
committerHans Dedecker <dedeckeh@gmail.com>
Tue, 23 Jun 2020 20:09:44 +0000 (22:09 +0200)
GCC10 mandates the C++ one definition rule, which breaks on multiple
definitions of config. Add the appropriate extern declaration.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
src/odhcpd.c
src/odhcpd.h

index 4b8e5898d450bc661e0f4d29b48dfff1f35a101c..c82ee1489990860eee9a22e2d7400635c983c43e 100644 (file)
@@ -43,8 +43,6 @@
 #include <libubox/uloop.h>
 #include "odhcpd.h"
 
-
-
 static int ioctl_sock = -1;
 static int urandom_fd = -1;
 
index 37a5a4a4c6e448683f7f4daae924e3d84b983059..d17fbfbecaaee6a5ef3664bbabb1f372d4b11fa7 100644 (file)
@@ -44,6 +44,7 @@
 struct interface;
 struct nl_sock;
 extern struct vlist_tree leases;
+extern struct config config;
 
 struct odhcpd_event {
        struct uloop_fd uloop;
@@ -138,7 +139,7 @@ struct config {
        char *dhcp_cb;
        char *dhcp_statefile;
        int log_level;
-} config;
+};
 
 
 struct lease {