hping3: add new package
[feed/packages.git] / net / hping3 / patches / 140_data_size_udp.patch
1 Subject: Fix incorrect data size check for UDP.
2 Author: Luca Bigliardi <shammash@artha.org>
3 Bug-Debian; http://bugs.debian.org/546590
4 Last-Update: 2009-09-19
5
6 --- a/parseoptions.c
7 +++ b/parseoptions.c
8 @@ -606,9 +606,12 @@ int parse_options(int argc, char **argv)
9 if (opt_numeric == TRUE) opt_gethost = FALSE;
10
11 /* some error condition */
12 - if (data_size+IPHDR_SIZE+TCPHDR_SIZE > 65535) {
13 + if (data_size+IPHDR_SIZE+
14 + (opt_udpmode?UDPHDR_SIZE:TCPHDR_SIZE) > 65535) {
15 printf("Option error: sorry, data size must be <= %lu\n",
16 - (unsigned long)(65535-IPHDR_SIZE+TCPHDR_SIZE));
17 + (unsigned long)(65535-(IPHDR_SIZE+
18 + (opt_udpmode?UDPHDR_SIZE:TCPHDR_SIZE)))
19 + );
20 exit(1);
21 }
22 else if (count <= 0 && count != -1) {