slackbuilds/network/hping3/patches/data_size_udp.diff

21 lines
585 B
Diff

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) {