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-analyzer/hping/files/, net-analyzer/hping/
Date: Tue, 18 Sep 2018 15:40:52
Message-Id: 1537285222.d268b7d634bb013cf5599ab3a5daacd5a5a28f7c.jer@gentoo
1 commit: d268b7d634bb013cf5599ab3a5daacd5a5a28f7c
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 18 15:40:22 2018 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 18 15:40:22 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d268b7d6
7
8 net-analyzer/hping: Merge sed scripts/patches into patches
9
10 Package-Manager: Portage-2.3.49, Repoman-2.3.10
11
12 .../hping/files/hping-3_pre20141226-compile.patch | 31 +++
13 .../files/hping-3_pre20141226-cross-compile.patch | 12 --
14 .../files/hping-3_pre20141226-hping2-2-hping.patch | 240 +++++++++++++++++++++
15 .../hping/files/hping-3_pre20141226-ldflags.patch | 11 -
16 net-analyzer/hping/hping-3_pre20141226.ebuild | 23 +-
17 5 files changed, 273 insertions(+), 44 deletions(-)
18
19 diff --git a/net-analyzer/hping/files/hping-3_pre20141226-compile.patch b/net-analyzer/hping/files/hping-3_pre20141226-compile.patch
20 new file mode 100644
21 index 00000000000..14b6eacdae4
22 --- /dev/null
23 +++ b/net-analyzer/hping/files/hping-3_pre20141226-compile.patch
24 @@ -0,0 +1,31 @@
25 +--- a/Makefile.in
26 ++++ b/Makefile.in
27 +@@ -6,10 +6,7 @@
28 + # $date: Sun Jul 25 17:56:15 MET DST 1999$
29 + # $rev: 3$
30 +
31 +-CC= gcc
32 +-AR=/usr/bin/ar
33 +-RANLIB=/usr/bin/ranlib
34 +-CCOPT= -O2 -Wall @PCAP_INCLUDE@ @TCL_INC@ @USE_TCL@
35 ++CCOPT= $(CFLAGS) -Wall @PCAP_INCLUDE@ @TCL_INC@ @USE_TCL@
36 + DEBUG= -g
37 + #uncomment the following if you need libpcap based build under linux
38 + #(not raccomanded)
39 +@@ -50,14 +47,11 @@
40 + $(RANLIB) $@
41 +
42 + hping3: byteorder.h $(OBJ)
43 +- $(CC) -o hping3 $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@
44 ++ $(CC) -o hping3 $(CCOPT) $(LDFLAGS) $(DEBUG) $(OBJ) -L/usr/$(LIBDIR) $(PCAP) @SOLARISLIB@ @TCL_LIB@
45 + @echo
46 +- ./hping3 -v
47 +- @echo "use \`make strip' to strip hping3 binary"
48 +- @echo "use \`make install' to install hping3"
49 +
50 + hping3-static: byteorder.h $(OBJ)
51 +- $(CC) -static -o hping3-static $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ -ldl
52 ++ $(CC) -static -o hping3-static $(CCOPT) $(DEBUG) $(OBJ) -L/usr/$(LIBDIR) $(PCAP) @SOLARISLIB@ @TCL_LIB@ -ldl
53 +
54 + byteorder.h:
55 + ./configure
56
57 diff --git a/net-analyzer/hping/files/hping-3_pre20141226-cross-compile.patch b/net-analyzer/hping/files/hping-3_pre20141226-cross-compile.patch
58 deleted file mode 100644
59 index 94dbfed9709..00000000000
60 --- a/net-analyzer/hping/files/hping-3_pre20141226-cross-compile.patch
61 +++ /dev/null
62 @@ -1,12 +0,0 @@
63 ---- a/Makefile.in
64 -+++ b/Makefile.in
65 -@@ -52,9 +52,6 @@
66 - hping3: byteorder.h $(OBJ)
67 - $(CC) -o hping3 $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@
68 - @echo
69 -- ./hping3 -v
70 -- @echo "use \`make strip' to strip hping3 binary"
71 -- @echo "use \`make install' to install hping3"
72 -
73 - hping3-static: byteorder.h $(OBJ)
74 - $(CC) -static -o hping3-static $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ -ldl
75
76 diff --git a/net-analyzer/hping/files/hping-3_pre20141226-hping2-2-hping.patch b/net-analyzer/hping/files/hping-3_pre20141226-hping2-2-hping.patch
77 new file mode 100644
78 index 00000000000..7ceaac921a0
79 --- /dev/null
80 +++ b/net-analyzer/hping/files/hping-3_pre20141226-hping2-2-hping.patch
81 @@ -0,0 +1,240 @@
82 +--- a/docs/hping3.8
83 ++++ b/docs/hping3.8
84 +@@ -1,8 +1,8 @@
85 +-.TH HPING2 8 "2001 Aug 14"
86 ++.TH HPING 8 "2001 Aug 14"
87 + .SH NAME
88 +-hping2 \- send (almost) arbitrary TCP/IP packets to network hosts
89 ++hping \- send (almost) arbitrary TCP/IP packets to network hosts
90 + .SH SYNOPSIS
91 +-.B hping2
92 ++.B hping
93 + [
94 + .B \-hvnqVDzZ012WrfxykQbFSRPAUXYjJBuTG
95 + ] [
96 +@@ -116,11 +116,11 @@
97 + .br
98 + .ad
99 + .SH DESCRIPTION
100 +-hping2 is a network tool able to send custom TCP/IP packets and to
101 +-display target replies like ping program does with ICMP replies. hping2
102 ++hping is a network tool able to send custom TCP/IP packets and to
103 ++display target replies like ping program does with ICMP replies. hping
104 + handle fragmentation, arbitrary packets body and size and can be used in
105 + order to transfer files encapsulated under supported protocols. Using
106 +-hping2 you are able to perform at least the following stuff:
107 ++hping you are able to perform at least the following stuff:
108 +
109 + - Test firewall rules
110 + - Advanced port scanning
111 +@@ -136,7 +136,7 @@
112 + - A lot of others.
113 +
114 + .IR "It's also a good didactic tool to learn TCP/IP" .
115 +-hping2 is developed and maintained by antirez@××××××.org and is
116 ++hping is developed and maintained by antirez@××××××.org and is
117 + licensed under GPL version 2. Development is open so you can send
118 + me patches, suggestion and affronts without inhibitions.
119 + .SH HPING SITE
120 +@@ -158,9 +158,9 @@
121 + .I -c --count count
122 + Stop after sending (and receiving)
123 + .I count
124 +-response packets. After last packet was send hping2 wait COUNTREACHED_TIMEOUT
125 ++response packets. After last packet was send hping wait COUNTREACHED_TIMEOUT
126 + seconds target host replies. You are able to tune COUNTREACHED_TIMEOUT editing
127 +-hping2.h
128 ++hping.h
129 + .TP
130 + .I -i --interval
131 + Wait
132 +@@ -171,10 +171,10 @@
133 + .I wait
134 + to X micro seconds.
135 + The default is to wait
136 +-one second between each packet. Using hping2 to transfer files tune this
137 ++one second between each packet. Using hping to transfer files tune this
138 + option is really important in order to increase transfer rate. Even using
139 +-hping2 to perform idle/spoofing scanning you should tune this option, see
140 +-.B HPING2-HOWTO
141 ++hping to perform idle/spoofing scanning you should tune this option, see
142 ++.B HPING-HOWTO
143 + for more information.
144 + .TP
145 + .I --fast
146 +@@ -195,13 +195,13 @@
147 + startup time and when finished.
148 + .TP
149 + .I -I --interface interface name
150 +-By default on linux and BSD systems hping2 uses default routing interface.
151 ++By default on linux and BSD systems hping uses default routing interface.
152 + In other systems or when there is no default route
153 +-hping2 uses the first non-loopback interface.
154 +-However you are able to force hping2 to use the interface you need using
155 ++hping uses the first non-loopback interface.
156 ++However you are able to force hping to use the interface you need using
157 + this option. Note: you don't need to specify the whole name, for
158 + example -I et will match eth0 ethernet0 myet1 et cetera. If no interfaces
159 +-match hping2 will try to use lo.
160 ++match hping will try to use lo.
161 + .TP
162 + .I -V --verbose
163 + Enable verbose output. TCP replies will be shown as follows:
164 +@@ -211,7 +211,7 @@
165 + .TP
166 + .I -D --debug
167 + Enable debug mode, it's useful when you experience some problem with
168 +-hping2. When debug mode is enabled you will get more information about
169 ++hping. When debug mode is enabled you will get more information about
170 + .B interface detection, data link layer access, interface settings, options
171 + .B parsing, fragmentation, HCMP protocol
172 + and other stuff.
173 +@@ -223,30 +223,30 @@
174 + CTRL+Z once or twice.
175 + .TP
176 + .I -Z --unbind
177 +-Unbind CTRL+Z so you will able to stop hping2.
178 ++Unbind CTRL+Z so you will able to stop hping.
179 + .TP
180 + .I --beep
181 + Beep for every matching received packet (but not for ICMP errors).
182 + .SH PROTOCOL SELECTION
183 +-Default protocol is TCP, by default hping2 will send tcp headers to target
184 ++Default protocol is TCP, by default hping will send tcp headers to target
185 + host's port 0 with a winsize of 64 without any tcp flag on. Often this
186 + is the best way to do an 'hide ping', useful when target is behind
187 + a firewall that drop ICMP. Moreover a tcp null-flag to port 0 has a good
188 + probability of not being logged.
189 + .TP
190 + .I -0 --rawip
191 +-RAW IP mode, in this mode hping2 will send IP header with data
192 ++RAW IP mode, in this mode hping will send IP header with data
193 + appended with --signature and/or --file, see also --ipproto that
194 + allows you to set the ip protocol field.
195 + .TP
196 + .I -1 --icmp
197 +-ICMP mode, by default hping2 will send ICMP echo-request, you can set
198 ++ICMP mode, by default hping will send ICMP echo-request, you can set
199 + other ICMP type/code using
200 + .B --icmptype --icmpcode
201 + options.
202 + .TP
203 + .I -2 --udp
204 +-UDP mode, by default hping2 will send udp to target host's port 0.
205 ++UDP mode, by default hping will send udp to target host's port 0.
206 + UDP header tunable options are the following:
207 + .B --baseport, --destport, --keep.
208 + .TP
209 +@@ -288,11 +288,11 @@
210 + shows interesting details.
211 + .TP
212 + .I -9 --listen signature
213 +-HPING2 listen mode, using this option hping2 waits for packet that contain
214 ++HPING listen mode, using this option hping waits for packet that contain
215 + .I signature
216 + and dump from
217 + .I signature
218 +-end to packet's end. For example if hping2 --listen TEST reads a packet
219 ++end to packet's end. For example if hping --listen TEST reads a packet
220 + that contain
221 + .B 234-09sdflkjs45-TESThello_world
222 + it will display
223 +@@ -304,7 +304,7 @@
224 + ensures that target will not gain your real address. However replies
225 + will be sent to spoofed address, so you will can't see them. In order
226 + to see how it's possible to perform spoofed/idle scanning see the
227 +-.BR HPING2-HOWTO .
228 ++.BR HPING-HOWTO .
229 + .TP
230 + .I --rand-source
231 + This option enables the
232 +@@ -347,7 +347,7 @@
233 + or
234 + .B --bind
235 + options. If in doubt try
236 +-.BR "" "`" "hping2 some.host.com -t 1 --traceroute" "'."
237 ++.BR "" "`" "hping some.host.com -t 1 --traceroute" "'."
238 + .TP
239 + .I -N --id
240 + Set ip->id field. Default id is random but if fragmentation is turned on
241 +@@ -361,11 +361,11 @@
242 + .I -W --winid
243 + id from Windows* systems before Win2k has different byte ordering, if this
244 + option is enable
245 +-hping2 will properly display id replies from those Windows.
246 ++hping will properly display id replies from those Windows.
247 + .TP
248 + .I -r --rel
249 + Display id increments instead of id. See the
250 +-.B HPING2-HOWTO
251 ++.B HPING-HOWTO
252 + for more information. Increments aren't computed as id[N]-id[N-1] but
253 + using packet loss compensation. See relid.c for more information.
254 + .TP
255 +@@ -445,7 +445,7 @@
256 + .SH TCP/UDP RELATED OPTIONS
257 + .TP
258 + .I -s --baseport source port
259 +-hping2 uses source port in order to guess replies sequence number. It
260 ++hping uses source port in order to guess replies sequence number. It
261 + starts with a base source port number, and increase this number for each
262 + packet sent. When packet is received sequence number can be computed as
263 + .IR "replies.dest.port - base.source.port" .
264 +@@ -485,7 +485,7 @@
265 + by target host. This can be useful when you need to analyze whether
266 + TCP sequence number is predictable. Output example:
267 +
268 +-.B #hping2 win98 --seqnum -p 139 -S -i u1 -I eth0
269 ++.B #hping win98 --seqnum -p 139 -S -i u1 -I eth0
270 + .nf
271 + HPING uaz (eth0 192.168.4.41): S set, 40 headers + 0 data bytes
272 + 2361294848 +2361294848
273 +@@ -540,8 +540,8 @@
274 + .SH COMMON OPTIONS
275 + .TP
276 + .I -d --data data size
277 +-Set packet body size. Warning, using --data 40 hping2 will not generate
278 +-0 byte packets but protocol_header+40 bytes. hping2 will display
279 ++Set packet body size. Warning, using --data 40 hping will not generate
280 ++0 byte packets but protocol_header+40 bytes. hping will display
281 + packet size information as first line output, like this:
282 + .B HPING www.yahoo.com (ppp0 204.71.200.67): NO FLAGS are set, 40 headers + 40 data bytes
283 + .TP
284 +@@ -577,9 +577,9 @@
285 + A to host B you may use the following:
286 + .nf
287 + .I [host_a]
288 +-.B # hping2 host_b --udp -p 53 -d 100 --sign signature --safe --file /etc/passwd
289 ++.B # hping host_b --udp -p 53 -d 100 --sign signature --safe --file /etc/passwd
290 + .I [host_b]
291 +-.B # hping2 host_a --listen signature --safe --icmp
292 ++.B # hping host_a --listen signature --safe --icmp
293 + .fi
294 + .TP
295 + .I -u --end
296 +@@ -587,13 +587,13 @@
297 + .I --file filename
298 + option, tell you when EOF has been reached. Moreover prevent that other end
299 + accept more packets. Please, for more information see the
300 +-.BR HPING2-HOWTO .
301 ++.BR HPING-HOWTO .
302 + .TP
303 + .I -T --traceroute
304 +-Traceroute mode. Using this option hping2 will increase ttl for each
305 ++Traceroute mode. Using this option hping will increase ttl for each
306 + .B ICMP time to live 0 during transit
307 + received. Try
308 +-.BR "hping2 host --traceroute" .
309 ++.BR "hping host --traceroute" .
310 + This option implies --bind and --ttl 1. You can override the ttl of 1
311 + using the --ttl option. Since 2.0.0 stable it prints RTT information.
312 + .TP
313 +@@ -601,7 +601,7 @@
314 + Keep the TTL fixed in traceroute mode, so you can monitor just one hop
315 + in the route. For example, to monitor how the 5th hop changes or
316 + how its RTT changes you can try
317 +-.BR "hping2 host --traceroute --ttl 5 --tr-keep-ttl" .
318 ++.BR "hping host --traceroute --ttl 5 --tr-keep-ttl" .
319 + .TP
320 + .I --tr-stop
321 + If this option is specified hping will exit once the first packet
322
323 diff --git a/net-analyzer/hping/files/hping-3_pre20141226-ldflags.patch b/net-analyzer/hping/files/hping-3_pre20141226-ldflags.patch
324 deleted file mode 100644
325 index c8874fb71d1..00000000000
326 --- a/net-analyzer/hping/files/hping-3_pre20141226-ldflags.patch
327 +++ /dev/null
328 @@ -1,11 +0,0 @@
329 ---- a/Makefile.in
330 -+++ b/Makefile.in
331 -@@ -50,7 +50,7 @@
332 - $(RANLIB) $@
333 -
334 - hping3: byteorder.h $(OBJ)
335 -- $(CC) -o hping3 $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@
336 -+ $(CC) -o hping3 $(CCOPT) $(LDFLAGS) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@
337 - @echo
338 -
339 - hping3-static: byteorder.h $(OBJ)
340
341 diff --git a/net-analyzer/hping/hping-3_pre20141226.ebuild b/net-analyzer/hping/hping-3_pre20141226.ebuild
342 index 4c3eecd65c6..72c3c724933 100644
343 --- a/net-analyzer/hping/hping-3_pre20141226.ebuild
344 +++ b/net-analyzer/hping/hping-3_pre20141226.ebuild
345 @@ -27,33 +27,14 @@ PATCHES=(
346 "${FILESDIR}"/${PN}-3_pre20051105-libtcl.patch
347 "${FILESDIR}"/${PN}-3_pre20051105-tcl.patch
348 "${FILESDIR}"/${PN}-3_pre20051105-tclsh-proper-escaping.patch
349 - "${FILESDIR}"/${PN}-3_pre20141226-cross-compile.patch
350 + "${FILESDIR}"/${PN}-3_pre20141226-compile.patch
351 + "${FILESDIR}"/${PN}-3_pre20141226-hping2-2-hping.patch
352 "${FILESDIR}"/${PN}-3_pre20141226-indent.patch
353 - "${FILESDIR}"/${PN}-3_pre20141226-ldflags.patch
354 "${FILESDIR}"/${PN}-3_pre20141226-pcap-bpf.patch
355 "${FILESDIR}"/${PN}-3_pre20141226-scan-overflow.patch
356 "${FILESDIR}"/${PN}-3_pre20141226-unused-but-set.patch
357 )
358
359 -src_prepare() {
360 - default
361 -
362 - # Correct hard coded values
363 - sed -i Makefile.in \
364 - -e '/^CC=/d' \
365 - -e '/^AR=/d' \
366 - -e '/^RANLIB=/d' \
367 - -e 's:/usr/local/lib:/usr/$(LIBDIR):g' \
368 - -e 's:-O2:$(CFLAGS):' \
369 - || die
370 -
371 - # Change name from hping2 to hping3
372 - sed -i docs/hping3.8 \
373 - -e 's|HPING2|HPING|g' \
374 - -e 's|hping2|hping|g' \
375 - || die
376 -}
377 -
378 src_configure() {
379 tc-export CC