diff options
Diffstat (limited to 'network/hping3/patches/data_size_udp.diff')
-rw-r--r-- | network/hping3/patches/data_size_udp.diff | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/network/hping3/patches/data_size_udp.diff b/network/hping3/patches/data_size_udp.diff new file mode 100644 index 0000000000..b10c243eb8 --- /dev/null +++ b/network/hping3/patches/data_size_udp.diff @@ -0,0 +1,20 @@ + +Fix incorrect data size check for UDP. + +--- a/parseoptions.c ++++ b/parseoptions.c +@@ -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) { |