[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: ping possible bug ("-I" option)
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2009-07-16 22:00:47
Message-ID: 200907170000.47525.vda.linux () googlemail ! com
[Download RAW message or body]

On Thursday 16 July 2009 17:58, Javier Viguera wrote:
> 
> Denys Vlasenko wrote:
> > 
> > This is interesting, but not enough info to see what control messages
> > are attached to the packet. Maybe here they specify that eth1
> > should be used.
> > 
> > Can you add -v option to strace and obtain the log again?
> > 
> > Please post it as attachment, to prevent linewrapping.
> > 
> > --
> > vda
> 
> Attached the new log of:
> 
> # strace -v -o ping.log -s99 ping -c3 -I eth1 192.168.105.1
> 
> Both files are post as attachments. Could be that my e-mail client 
> (thunderbird) is doing the line wrapping. In case the text file is line 
> wrapped you could try the zip one.

Unfortunately even strace -v is not showing everything.

Anyway, from the available log I can only conclude that
ping -I <iface> uses sendmsg() with control message
with cmsg_type=IP_PKTINFO, which contains struct in_pktinfo
with ->oif = iface_index. Obviously, it does not really
enforce the interface in this case. This may be a kernel bug,
I don't know... Also, it does not restrict receiving to that interface.

busybox's ping treats -I <iface> as "send and receive only from/to
that iface". It does that differently, using
setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, "iface\0", n)
before sending/receiving.

--
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic