Package: hping3 Version: 3.a2.ds2-4 Severity: normal Tags: patch
Hi, it seems hping3, when working in udp mode, checks the size passed to --data option with the size of a tcp header. The attached patch should fix the problem using UDPHDR_SIZE when udp mode is set, otherwise using TCPHDR_SIZE. Please can you forward this patch upstream? Many parts of their website seem down so I was not able to checkout latest sources and send a proper patch to them. Thank you, Luca -- System Information: Debian Release: squeeze/sid APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental') Architecture: i386 (i686) Kernel: Linux 2.6.30.5-ipn Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages hping3 depends on: ii libc6 2.9-18 GNU C Library: Shared libraries ii libpcap0.8 1.0.0-2 system interface for user-level pa ii tcl8.4 8.4.19-4 Tcl (the Tool Command Language) v8 hping3 recommends no packages. hping3 suggests no packages. -- no debconf information
--- parseoptions.c_ORIG 2009-09-14 12:01:07.000000000 +0100 +++ parseoptions.c 2009-09-14 12:01:17.000000000 +0100 @@ -569,9 +573,12 @@ if (opt_numeric == TRUE) opt_gethost = FALSE; /* some error condition */ - if (data_size+IPHDR_SIZE+TCPHDR_SIZE > 65535) { + if (data_size+IPHDR_SIZE+ + (opt_udpmode?UDPHDR_SIZE:TCPHDR_SIZE) > 65535) { printf("Option error: sorry, data size must be <= %lu\n", - (unsigned long)(65535-IPHDR_SIZE+TCPHDR_SIZE)); + (unsigned long)(65535-(IPHDR_SIZE+ + (opt_udpmode?UDPHDR_SIZE:TCPHDR_SIZE))) + ); exit(1); } else if (count <= 0 && count != -1) {