[Toybox] Puzzle about ping implementation of toybox

Longjun Luo luolongjuna at gmail.com
Tue Feb 25 10:27:31 PST 2020


Hi guys:

Recently, I just got in touch with toybox. And I have some puzzles about
ping implementation.

(1) toybox uses unprivileged ICMP sockets to avoid unnecessary root
privilege.
However, it depends highly on kernel support. I can not use ping since my
kernle is not linux and it does not support such usage.

(2) toybox uses unprivileged ICMP but does not set socket with flag IP_HDRINCL.

So, it is impossible to get ttl info when gets reply from aim host since we
can not get ip header. Currently toybox will print "ttl = 0".
I wonder if it is a balance of simple and feature.

I assume there are some reasons I do not find. So, i just send a patch to
fix some trivial issues in ping.c. Hope someone can solve my puzzles.

best wishes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20200226/7a8ced20/attachment.htm>


More information about the Toybox mailing list