diff mbox series

odhcpd: fix compilation with GCC10

Message ID 20200622043736.1558582-1-rosenp@gmail.com
State Accepted
Headers show
Series odhcpd: fix compilation with GCC10 | expand

Commit Message

Rosen Penev June 22, 2020, 4:37 a.m. UTC
GCC10 mandates the C++ one definition rule, which breaks on multiple
definitions of config. Add the appropriate extern declarations.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 src/dhcpv6-ia.c | 2 ++
 src/odhcpd.c    | 2 +-
 src/odhcpd.h    | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c
index 38a901b..60368cb 100644
--- a/src/dhcpv6-ia.c
+++ b/src/dhcpv6-ia.c
@@ -39,6 +39,8 @@ 
     ((iface)->dhcpv6_assignall || (i) == (m) || \
      (addrs)[(i)].prefix > 64)
 
+extern struct config config;
+
 static void dhcpv6_netevent_cb(unsigned long event, struct netevent_handler_info *info);
 static void apply_lease(struct dhcp_assignment *a, bool add);
 static void set_border_assignment_size(struct interface *iface, struct dhcp_assignment *b);
diff --git a/src/odhcpd.c b/src/odhcpd.c
index 26094b1..d781ca7 100644
--- a/src/odhcpd.c
+++ b/src/odhcpd.c
@@ -43,7 +43,7 @@ 
 #include <libubox/uloop.h>
 #include "odhcpd.h"
 
-
+extern struct config config;
 
 static int ioctl_sock = -1;
 static int urandom_fd = -1;
diff --git a/src/odhcpd.h b/src/odhcpd.h
index 072a148..b0ad8d0 100644
--- a/src/odhcpd.h
+++ b/src/odhcpd.h
@@ -139,7 +139,7 @@  struct config {
 	char *dhcp_cb;
 	char *dhcp_statefile;
 	int log_level;
-} config;
+};
 
 
 struct lease {