[PATCH] ping.c: Add -t TTL support

Denys Vlasenko vda.linux at googlemail.com
Sun Nov 28 22:04:11 UTC 2010


On Sunday 21 November 2010 01:21, Joachim Nilsson wrote:
> Hi, maybe someone else is also interested in this.
> 
> I was testing multicast routing (pimd) on a server today and needed a
> very simple multicast generator.  Calling BusyBox "ping 225.1.2.3" sends
> out a neat UDP multicast stream of one packet per second, simple enough
> for my purposes.  However, for multicast ICMP_ECHO defaults to a TTL of
> 1, whereas unicast gets 64.  Hence this little patch.

I tested "standard" ping -t TTL and it uses:

setsockopt(3, SOL_IP, IP_TTL, [<ttl_val>], 4);

I changed IP_MULTICAST_TTL to IP_TTL that in your patch and applied it.
Please test current git and let me know if it doesn't work for you.

-- 
vda


More information about the busybox mailing list