fix multiple defination with gcc 10

This commit is contained in:
renmingshuai 2021-07-30 22:10:31 +08:00
parent e2f4d343b2
commit d8add97632
3 changed files with 77 additions and 1 deletions

View File

@ -0,0 +1,43 @@
From 49cbb576f142032e1fb687a58284a1d032d87770 Mon Sep 17 00:00:00 2001
From: renmingshuai <renmingshuai@huawei.com>
Date: Fri, 30 Jul 2021 21:35:20 +0800
Subject: [PATCH] fix multiple definition with gcc 10
---
client/dhclient.c | 4 ++--
relay/dhcrelay.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/client/dhclient.c b/client/dhclient.c
index 2a17bfd..f2c2630 100644
--- a/client/dhclient.c
+++ b/client/dhclient.c
@@ -93,8 +93,8 @@ static const char message [] = "Internet Systems Consortium DHCP Client";
static const char url [] = "For info, please visit https://www.isc.org/software/dhcp/";
#endif /* UNIT_TEST */
-u_int16_t local_port = 0;
-u_int16_t remote_port = 0;
+extern u_int16_t local_port;
+extern u_int16_t remote_port;
#if defined(DHCPv6) && defined(DHCP4o6)
int dhcp4o6_state = -1; /* -1 = stopped, 0 = polling, 1 = started */
#endif
diff --git a/relay/dhcrelay.c b/relay/dhcrelay.c
index 155dd37..b487373 100644
--- a/relay/dhcrelay.c
+++ b/relay/dhcrelay.c
@@ -104,8 +104,8 @@ enum { forward_and_append, /* Forward and append our own relay option. */
forward_untouched, /* Forward without changes. */
discard } agent_relay_mode = forward_and_replace;
-u_int16_t local_port;
-u_int16_t remote_port;
+extern u_int16_t local_port;
+extern u_int16_t remote_port;
/* Relay agent server list. */
struct server_list {
--
1.8.3.1

View File

@ -0,0 +1,25 @@
From 2f366470c90387ffae73b34390f6b8e61acb2b3b Mon Sep 17 00:00:00 2001
From: renmingshuai <renmingshuai@huawei.com>
Date: Fri, 30 Jul 2021 21:52:55 +0800
Subject: [PATCH] fix multiple definition with gcc 10
---
server/omapi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/server/omapi.c b/server/omapi.c
index f741131..a6a3651 100644
--- a/server/omapi.c
+++ b/server/omapi.c
@@ -47,7 +47,7 @@ omapi_object_type_t *dhcp_type_lease;
omapi_object_type_t *dhcp_type_pool;
omapi_object_type_t *dhcp_type_class;
omapi_object_type_t *dhcp_type_subclass;
-omapi_object_type_t *dhcp_type_host;
+extern omapi_object_type_t *dhcp_type_host;
#if defined (FAILOVER_PROTOCOL)
omapi_object_type_t *dhcp_type_failover_state;
omapi_object_type_t *dhcp_type_failover_link;
--
1.8.3.1

View File

@ -3,7 +3,7 @@
Name: dhcp
Version: 4.4.2
Release: 6
Release: 7
Summary: Dynamic host configuration protocol software
#Please don't change the epoch on this package
Epoch: 12
@ -54,6 +54,8 @@ Patch32: bugfix-dhclient-check-if-pid-was-held.patch
Patch33: bugfix-dhcp-64-bit-lease-parse.patch
Patch34: dhcp-remove-bind.patch
Patch35: CVE-2021-25217.patch
Patch36: 0001-fix-multiple-definition-with-gcc-10.patch
Patch37: 0002-fix-multiple-definition-with-gcc-10.patch
BuildRequires: gcc autoconf automake libtool openldap-devel krb5-devel libcap-ng-devel bind-export-devel
BuildRequires: systemd systemd-devel
@ -288,6 +290,12 @@ exit 0
%{_mandir}/man3/omapi.3.gz
%changelog
* Fri Jul 30 2021 renmingshuai <renmingshuai@huawei.com> - 4.4.2-7
- Type:bugfix
- ID:NA
- SUG:restart
- DESC:fix multiple defination with gcc 10
* Mon May 31 2021 renmingshuai <renmingshuai@huawei.com> - 4.4.2-6
- Type:CVE
- ID:NA