From d8add97632c2a4b531fa4e5f9056a7756936612e Mon Sep 17 00:00:00 2001 From: renmingshuai Date: Fri, 30 Jul 2021 22:10:31 +0800 Subject: [PATCH] fix multiple defination with gcc 10 --- ...-fix-multiple-definition-with-gcc-10.patch | 43 +++++++++++++++++++ ...-fix-multiple-definition-with-gcc-10.patch | 25 +++++++++++ dhcp.spec | 10 ++++- 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 0001-fix-multiple-definition-with-gcc-10.patch create mode 100644 0002-fix-multiple-definition-with-gcc-10.patch diff --git a/0001-fix-multiple-definition-with-gcc-10.patch b/0001-fix-multiple-definition-with-gcc-10.patch new file mode 100644 index 0000000..71b05b0 --- /dev/null +++ b/0001-fix-multiple-definition-with-gcc-10.patch @@ -0,0 +1,43 @@ +From 49cbb576f142032e1fb687a58284a1d032d87770 Mon Sep 17 00:00:00 2001 +From: renmingshuai +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 + diff --git a/0002-fix-multiple-definition-with-gcc-10.patch b/0002-fix-multiple-definition-with-gcc-10.patch new file mode 100644 index 0000000..d38aa6a --- /dev/null +++ b/0002-fix-multiple-definition-with-gcc-10.patch @@ -0,0 +1,25 @@ +From 2f366470c90387ffae73b34390f6b8e61acb2b3b Mon Sep 17 00:00:00 2001 +From: renmingshuai +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 + diff --git a/dhcp.spec b/dhcp.spec index 25a313e..8fd9aa3 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -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 - 4.4.2-7 +- Type:bugfix +- ID:NA +- SUG:restart +- DESC:fix multiple defination with gcc 10 + * Mon May 31 2021 renmingshuai - 4.4.2-6 - Type:CVE - ID:NA -- Gitee