Page MenuHomeFreeBSD

sbin/ping: allow normal users to specify larger packets
ClosedPublic

Authored by pfg on Jun 28 2024, 9:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 9 2024, 2:49 PM
Unknown Object (File)
Aug 24 2024, 12:28 PM
Unknown Object (File)
Aug 9 2024, 8:18 AM
Unknown Object (File)
Jul 30 2024, 1:46 AM
Unknown Object (File)
Jul 8 2024, 4:12 AM
Unknown Object (File)
Jul 3 2024, 10:25 AM
Unknown Object (File)
Jul 1 2024, 4:55 PM
Unknown Object (File)
Jun 30 2024, 1:07 AM

Details

Summary

Only super-user could specify a packet size larger than the default 56 bytes.
This restriction was added by Matt Dillon in 1998 during the BEST days [0].
This restriction doesn't exist in ping IPV6 or on NetBSD, OpenBSD and Linux.

UMS [1] uses this feature to estimate the client's bandwidth to optimize the
streaming experience.

[0] Git 526f06b278d9252add168aa18b60242c08771165
[1] UMS: https://github.com/UniversalMediaServer/UniversalMediaServer

Obtained from: DragonFlyBSD

Sidenotes: MAXICMPLEN seems to be unused in the current code and I had to sign cast a value in MAXIPLEN to make the compiler happy.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

pfg requested review of this revision.Jun 28 2024, 9:19 PM
pfg created this revision.

So the kernel does not have a real limit ( only super-user could specify a packet size larger than the default 56 bytes ) ?

This revision is now accepted and ready to land.Jul 1 2024, 9:31 AM
sbin/ping/ping.c
461โ€“464

I think this is actually redundant (code below would check and calculate a more accurate limit).

sbin/ping/ping.c
461โ€“464

While the check does seem redundant and is only for non-root, the case only applies when "-s" is specified. Other checks may not apply

Hmm... would you mean just making -s a no-op?