diff --git a/ci/test-03-forbidden.pl b/ci/test-03-forbidden.pl index c42c6672..aca6e9ce 100755 --- a/ci/test-03-forbidden.pl +++ b/ci/test-03-forbidden.pl @@ -38,11 +38,11 @@ END $cmd7->stdout_is_eq(""); $cmd7->stderr_is_eq("fping: specify only one of c, l\n"); -# fping -b 65509 -my $cmd8 = Test::Command->new(cmd => "fping -b 65509 127.0.0.1"); +# fping -b 65508 +my $cmd8 = Test::Command->new(cmd => "fping -b 65508 127.0.0.1"); $cmd8->exit_is_num(1); $cmd8->stdout_is_eq(""); -$cmd8->stderr_is_eq("fping: data size 65509 not valid, must be lower than 65488\n"); +$cmd8->stderr_is_eq("fping: data size 65508 not valid, must be lower than 65507\n"); # fping -B 0.9 my $cmd9 = Test::Command->new(cmd => "fping -B 0.9 127.0.0.1"); diff --git a/src/fping.c b/src/fping.c index 696a017b..431716f2 100644 --- a/src/fping.c +++ b/src/fping.c @@ -134,8 +134,8 @@ extern int h_errno; /*** Ping packet defines ***/ -#define MAX_IP_PACKET 65536 /* (theoretical) max IP packet size */ -#define SIZE_IP_HDR 40 +#define MAX_IP_PACKET 65535 /* (theoretical) max IPv4 packet size */ +#define SIZE_IP_HDR 20 /* min IPv4 header size */ #define SIZE_ICMP_HDR 8 /* from ip_icmp.h */ #define MAX_PING_DATA (MAX_IP_PACKET - SIZE_IP_HDR - SIZE_ICMP_HDR)