patch - ping select interface.

Denys Vlasenko vda.linux at googlemail.com
Fri Oct 19 21:32:09 UTC 2007


On Friday 19 October 2007 07:21, Loïc Grenié wrote:
> 2007/10/19, Bob Keyes <bob at eecs.harvard.edu>:
> > I am new here, not sure of the
> > regular way I am supposed to make contributions, but whoever is in charge
> > of accepting patches please take a look at
> > https://dev.openwrt.org/ticket/2522 which will explain the rational for
> > the feature and includes the patch for it.
> 
>     I took the liberty to make the patch against current svn.
> 
>        Loïc Grenié

Thanks! It made it really trivial for me to fix it.

One question for IPv6 gurus: for ipv6 we have this:

static void ping6(len_and_sockaddr *lsa)
{
        if (opt_I)
                setsockopt(pingsock, SOL_SOCKET, SO_BINDTODEVICE, opt_I, strlen(opt_I) + 1);
...
        if (if_index)
                pingaddr.sin6.sin6_scope_id = if_index;
...
int ping_main(int argc, char **argv)
{
...
        if (option_mask32 & OPT_I) { // -I
                if_index = if_nametoindex(opt_I);


Seems redundant for me. Are these two different (equally valid)
ways of setting IPv6 source interface or is one of them wrong?
I don't know enough about IPv6.

I will aplly it as-is, can remove one of those later if deemed ok.
--
vda



More information about the busybox mailing list