Hi,
The maximum payload in ping.c (all source has been run through cat -n) is:
92 #define MAXPAYLOAD (IP_MAXPACKET - MAXIPLEN - 8) /* max
ICMP payload size */
which consists of:
90 #define MAXIPLEN 60
This is the maximum IP len since the value is leftshifted by 2 and
consists the size of a nibble (4 bits).
60 dec == 111100 bin
...and 8 bytes which is probably meant by ICMP_MINLEN defined in
/usr/include/netinet/ip_icmp.h.
The check where you're running into is here:
294 case 's': /* size of packet to send */
295 datalen = strtonum(optarg, 0,
MAXPAYLOAD, &errstr);
296 if (errstr)
297 errx(1, "packet size is %s: %s",
errstr,
298 optarg);
299 break;
I hope that helps?
-peter
On 08/02/16 21:14, Friedrich Locke wrote:
> Hi folks,
>
> i am pinging my desktop from a obsd machine and i am very curious about the
> size of packet an sending. Here you have it:
>
> sioux@etosha$ ping -s 65467 gustav.cpd.ufv.br
> PING gustav.cpd.ufv.br (200.235.177.58): 65467 data bytes
> 65475 bytes from 200.235.177.58: icmp_seq=0 ttl=63 time=12.241 ms
> 65475 bytes from 200.235.177.58: icmp_seq=1 ttl=63 time=11.940 ms
> --- gustav.cpd.ufv.br ping statistics ---
> 2 packets transmitted, 2 packets received, 0.0% packet loss
> round-trip min/avg/max/std-dev = 11.940/12.090/12.241/0.186 ms
> sioux@etosha$ ping -s 65468 gustav.cpd.ufv.br
> ping: packet size is too large: 65468
> sioux@etosha$
>
> I cannot ping with a message size above 65467, why ?
> I realize the difference between 65535 and 65467 is 68 bytes. What is obsd
> accounting for ?
>
> Thanks in advance.