Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/nemesis/, net-misc/nemesis/files/
Date: Fri, 31 Jan 2020 15:28:25
Message-Id: 1580484498.24a56226228d802b32fe2f383dcb4301a447b41f.jer@gentoo
1 commit: 24a56226228d802b32fe2f383dcb4301a447b41f
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 31 15:27:53 2020 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 31 15:28:18 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24a56226
7
8 net-misc/nemesis: Fix CFLAGS=-fno-common
9
10 Package-Manager: Portage-2.3.86, Repoman-2.3.20
11 Closes: https://bugs.gentoo.org/show_bug.cgi?id=707292
12 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
13
14 .../nemesis/files/nemesis-1.4-fno-common.patch | 150 +++++++++++++++++++++
15 net-misc/nemesis/nemesis-1.4-r2.ebuild | 36 +++++
16 2 files changed, 186 insertions(+)
17
18 diff --git a/net-misc/nemesis/files/nemesis-1.4-fno-common.patch b/net-misc/nemesis/files/nemesis-1.4-fno-common.patch
19 new file mode 100644
20 index 00000000000..068fef61b6e
21 --- /dev/null
22 +++ b/net-misc/nemesis/files/nemesis-1.4-fno-common.patch
23 @@ -0,0 +1,150 @@
24 +--- a/src/nemesis.c
25 ++++ b/src/nemesis.c
26 +@@ -12,6 +12,8 @@
27 + #include <string.h>
28 + #include "nemesis.h"
29 +
30 ++int mode; /* injection mode */
31 ++
32 + int main(int argc, char **argv)
33 + {
34 + char **avtmp, *avval;
35 +--- a/src/nemesis-dns.c
36 ++++ b/src/nemesis-dns.c
37 +@@ -37,6 +37,8 @@
38 + static void dns_validatedata(void);
39 + static void dns_verbose(void);
40 +
41 ++int state; /* default to UDP */
42 ++
43 + void nemesis_dns(int argc, char **argv)
44 + {
45 + const char *module = "DNS Packet Injection";
46 +--- a/src/nemesis-dns.h
47 ++++ b/src/nemesis-dns.h
48 +@@ -32,7 +32,7 @@
49 + #include <libnet-1.0.h>
50 + #include "nemesis.h"
51 +
52 +-int state; /* default to UDP */
53 ++extern int state; /* default to UDP */
54 +
55 + int builddns(ETHERhdr *, IPhdr *, TCPhdr *, UDPhdr *, DNShdr *, FileData *,
56 + FileData *, FileData *, char *);
57 +--- a/src/nemesis.h
58 ++++ b/src/nemesis.h
59 +@@ -122,6 +122,8 @@
60 + extern int got_ipoptions;
61 + extern int got_tcpoptions;
62 +
63 ++extern int mode; /* injection mode */
64 ++
65 + typedef struct _FileData
66 + {
67 + int32_t file_s; /* file size */
68 +--- a/src/nemesis-icmp.c
69 ++++ b/src/nemesis-icmp.c
70 +@@ -38,6 +38,8 @@
71 + static void icmp_validatedata(void);
72 + static void icmp_verbose(void);
73 +
74 ++int got_origoptions;
75 ++
76 + void nemesis_icmp(int argc, char **argv)
77 + {
78 + const char *module = "ICMP Packet Injection";
79 +--- a/src/nemesis-icmp.h
80 ++++ b/src/nemesis-icmp.h
81 +@@ -42,8 +42,7 @@
82 + #include <libnet-1.0.h>
83 + #include "nemesis.h"
84 +
85 +-int mode; /* ICMP injection mode */
86 +-int got_origoptions;
87 ++extern int got_origoptions;
88 +
89 + int buildicmp(ETHERhdr *, IPhdr *, ICMPhdr *, IPhdr *, FileData *, FileData *,
90 + FileData *, char *);
91 +--- a/src/nemesis-ospf.c
92 ++++ b/src/nemesis-ospf.c
93 +@@ -15,6 +15,37 @@
94 + #include <pcap.h>
95 + #endif
96 +
97 ++u_short id, /* IP id */
98 ++ frag, /* frag shit */
99 ++ mtusize, /* Max dgram length (DBD) */
100 ++ num, /* LSA_RTR num */
101 ++ interval, /* secs since last pkt sent */
102 ++ rtr_flags, /* LSA_RTR flags */
103 ++ metric, /* OSPF metric */
104 ++ ospf_age; /* OSPF advertisement age */
105 ++
106 ++u_long source, /* source address */
107 ++ dest, /* destination address */
108 ++ neighbor, /* neighbor router */
109 ++ as_fwd, /* AS_EXT forward address */
110 ++ addrid, /* advertising router id */
111 ++ addaid, /* advertising area id */
112 ++ router, /* advertising router */
113 ++ auth[2], /* authentication type */
114 ++ mask; /* subnet mask (icmp_mask) */
115 ++
116 ++u_char priority, /* OSPF priority */
117 ++ exchange, /* DBD exchange type */
118 ++ rtrtype, /* LSA_RTR type */
119 ++ ooptions; /* OSPF options */
120 ++
121 ++u_int dead_int, /* dead router interval in secs */
122 ++ as_tag, /* AS_EXT tag */
123 ++ seqnum, /* seqnum for LSA */
124 ++ bcastnum, /* num of LSAs to bcast (LSU) */
125 ++ rtrdata, /* LSA_RTR router data */
126 ++ rtrid; /* router id for LSA */
127 ++
128 + static ETHERhdr etherhdr;
129 + static IPhdr iphdr;
130 + static OSPFhdr ospfhdr;
131 +--- a/src/nemesis-ospf.h
132 ++++ b/src/nemesis-ospf.h
133 +@@ -35,7 +35,7 @@
134 + #include <libnet-1.0.h>
135 + #include "nemesis.h"
136 +
137 +-u_short id, /* IP id */
138 ++extern u_short id, /* IP id */
139 + frag, /* frag shit */
140 + mtusize, /* Max dgram length (DBD) */
141 + num, /* LSA_RTR num */
142 +@@ -44,7 +44,7 @@
143 + metric, /* OSPF metric */
144 + ospf_age; /* OSPF advertisement age */
145 +
146 +-u_long source, /* source address */
147 ++extern u_long source, /* source address */
148 + dest, /* destination address */
149 + neighbor, /* neighbor router */
150 + as_fwd, /* AS_EXT forward address */
151 +@@ -54,20 +54,18 @@
152 + auth[2], /* authentication type */
153 + mask; /* subnet mask (icmp_mask) */
154 +
155 +-u_char priority, /* OSPF priority */
156 ++extern u_char priority, /* OSPF priority */
157 + exchange, /* DBD exchange type */
158 + rtrtype, /* LSA_RTR type */
159 + ooptions; /* OSPF options */
160 +
161 +-u_int dead_int, /* dead router interval in secs */
162 ++extern u_int dead_int, /* dead router interval in secs */
163 + as_tag, /* AS_EXT tag */
164 + seqnum, /* seqnum for LSA */
165 + bcastnum, /* num of LSAs to bcast (LSU) */
166 + rtrdata, /* LSA_RTR router data */
167 + rtrid; /* router id for LSA */
168 +
169 +-int mode; /* OSPF injection mode */
170 +-
171 + int buildospf(ETHERhdr *, IPhdr *, FileData *, FileData *, char *);
172 +
173 + #endif /* __NEMESIS_OSPF_H__ */
174
175 diff --git a/net-misc/nemesis/nemesis-1.4-r2.ebuild b/net-misc/nemesis/nemesis-1.4-r2.ebuild
176 new file mode 100644
177 index 00000000000..e7b2e7d1891
178 --- /dev/null
179 +++ b/net-misc/nemesis/nemesis-1.4-r2.ebuild
180 @@ -0,0 +1,36 @@
181 +# Copyright 1999-2020 Gentoo Authors
182 +# Distributed under the terms of the GNU General Public License v2
183 +
184 +EAPI=7
185 +inherit autotools
186 +
187 +DESCRIPTION="A commandline-based, portable human IP stack for UNIX/Linux"
188 +HOMEPAGE="http://nemesis.sourceforge.net/"
189 +SRC_URI="mirror://sourceforge/${PN}/${P/_}.tar.gz"
190 +
191 +LICENSE="BSD"
192 +SLOT="0"
193 +KEYWORDS="~alpha ~amd64 ~sparc ~x86"
194 +
195 +RDEPEND="
196 + net-libs/libpcap
197 +"
198 +DEPEND="
199 + ${RDEPEND}
200 + =net-libs/libnet-1.0*
201 +"
202 +
203 +DOCS="CREDITS ChangeLog README"
204 +
205 +PATCHES=(
206 + "${FILESDIR}"/${P}-fileio.patch
207 + "${FILESDIR}"/${P}-libnet-1.0.patch
208 + "${FILESDIR}"/${P}-prototcp.patch
209 +)
210 +
211 +src_prepare() {
212 + default
213 +for i in src/*.[ch]; do cp -av $i $i.orig || die; done
214 + eapply "${FILESDIR}"/${P}-fno-common.patch
215 + eautoreconf
216 +}