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
8 @@ -606,9 +606,12 @@ int parse_options(int argc, char **argv)
9 if (opt_numeric == TRUE) opt_gethost = FALSE;
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)))
22 else if (count <= 0 && count != -1) {