Gentoo Archives: gentoo-commits

From: Sergey Popov <pinkbyte@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/dhcdrop/files/, net-misc/dhcdrop/
Date: Tue, 23 Aug 2022 07:05:12
Message-Id: 1661238181.1356604f1f11718271781b70014347f1cafff82e.pinkbyte@gentoo
1 commit: 1356604f1f11718271781b70014347f1cafff82e
2 Author: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 23 07:02:49 2022 +0000
4 Commit: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 23 07:03:01 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1356604f
7
8 net-misc/dhcdrop: bump EAPI to 8, fix building with -flto
9
10 Reported-by: Agostino Sarubbo <ago <AT> gentoo.org>
11 Package-Manager: Portage-3.0.30, Repoman-3.0.3
12 Signed-off-by: Vladimir Pavljuchenkov <spiderx <AT> spiderx.dp.ua>
13 Signed-off-by: Sergey Popov <pinkbyte <AT> gentoo.org>
14 Closes: https://bugs.gentoo.org/861608
15 Closes: https://github.com/gentoo/gentoo/pull/26942
16
17 net-misc/dhcdrop/dhcdrop-0.5-r1.ebuild | 11 +++++++---
18 net-misc/dhcdrop/files/dhcdrop-0.5-lto.patch | 33 ++++++++++++++++++++++++++++
19 2 files changed, 41 insertions(+), 3 deletions(-)
20
21 diff --git a/net-misc/dhcdrop/dhcdrop-0.5-r1.ebuild b/net-misc/dhcdrop/dhcdrop-0.5-r1.ebuild
22 index 5757f718f4d5..a8e991173aaa 100644
23 --- a/net-misc/dhcdrop/dhcdrop-0.5-r1.ebuild
24 +++ b/net-misc/dhcdrop/dhcdrop-0.5-r1.ebuild
25 @@ -1,7 +1,7 @@
26 -# Copyright 1999-2020 Gentoo Authors
27 +# Copyright 1999-2022 Gentoo Authors
28 # Distributed under the terms of the GNU General Public License v2
29
30 -EAPI=7
31 +EAPI=8
32
33 DESCRIPTION="Effectively suppresses illegal DHCP servers on the LAN"
34 HOMEPAGE="http://www.netpatch.ru/dhcdrop.html"
35 @@ -19,13 +19,18 @@ DEPEND="static? ( net-libs/libpcap[static-libs] )
36
37 DOCS=( AUTHORS ChangeLog INSTALL NEWS README )
38
39 +PATCHES=(
40 + # Fix building with -flto, bug #861608
41 + "${FILESDIR}/${P}-lto.patch"
42 +)
43 +
44 src_prepare() {
45 # Fix building with clang, bug #731694
46 sed -i \
47 -e '/^PACKAGE_/s/"//g' \
48 configure || die
49
50 - eapply_user
51 + default
52 }
53
54 src_configure() {
55
56 diff --git a/net-misc/dhcdrop/files/dhcdrop-0.5-lto.patch b/net-misc/dhcdrop/files/dhcdrop-0.5-lto.patch
57 new file mode 100644
58 index 000000000000..240303aa2bf2
59 --- /dev/null
60 +++ b/net-misc/dhcdrop/files/dhcdrop-0.5-lto.patch
61 @@ -0,0 +1,33 @@
62 +--- a/src/dhcdrop.h 2022-08-23 09:57:15.594679182 +0300
63 ++++ b/src/dhcdrop.h 2022-08-23 09:57:31.034678048 +0300
64 +@@ -207,9 +207,9 @@
65 + inline void replace_semicolons(char * str_ether);
66 +
67 + /* Print ethernet address as hex-digits string */
68 +-inline void print_ether(const uint8_t * ether_addr);
69 ++static void print_ether(const uint8_t * ether_addr);
70 +
71 + /* Create random ethernet address and store to string 'str_mac_addr' */
72 +-inline void rand_ether_addr(char * str_mac_addr);
73 ++static void rand_ether_addr(char * str_mac_addr);
74 +
75 + #endif /* ifdef DHCDROP_H*/
76 +--- a/src/dhcdrop.c 2022-08-23 09:57:09.522679628 +0300
77 ++++ b/src/dhcdrop.c 2022-08-23 09:57:47.810676815 +0300
78 +@@ -1879,14 +1879,14 @@
79 + }
80 + }
81 +
82 +-inline void print_ether(const uint8_t * ether_addr)
83 ++static void print_ether(const uint8_t * ether_addr)
84 + {
85 + int i;
86 + for(i = 0; i < ETH_ALEN; ++i)
87 + printf((i == (ETH_ALEN - 1) ) ? "%02X" :"%02X:", ether_addr[i]);
88 + }
89 +
90 +-inline void rand_ether_addr(char * str_mac_addr) /* Minimal size of str_mac_addr must be STR_MAC_LEN (18) */
91 ++static void rand_ether_addr(char * str_mac_addr) /* Minimal size of str_mac_addr must be STR_MAC_LEN (18) */
92 + {
93 + /* Fill first byte */
94 + strncat(str_mac_addr, "00:", 3);