Re: git: b88df1e893c4 - main - Reapply "sbin/ping: allow normal users to specify larger packets"

From: <maxim_at_freebsd.org>
Date: Fri, 18 Oct 2024 19:41:03 UTC
Hi Pedro,

Unless you have a plan to address this issue please backout this code
as it is clearly wrong.

Thanks,

Maxim

On Wed, 16 Oct 2024, 19:04-0000, Maxim Konovalov wrote:

> Hi Pedro,
>
> No, this is not right.  Let me clarify:
>
> (1) I never told that there are any issues with the tests.  I just
> mumbled that the tests should catch such regression though I never
> checked if they actually did.
>
> (2) The MAXPAYLOAD calculation in the code below is not fully correct.
>
> It should be
>
> 65535 - 20 (ip header) - 8 (icmp part) = 65507 without IP options
>
> OR
>
> 65535 - 20 (ip header) - 40 (ip options) - 8 (icmp part) = 65467 with
> IP options, ie. whenever you run ping -R.
>
> The code below hardcoded the latter value which is simply wrong.
>
> I wouldn't rely on the fact that you get it from other BSD flavours
> and would recommend to have this code reviewed before committing it.
>
> Maxim
>

-- 
Maxim Konovalov