On Thu, Jul 16, 2009 at 2:46 PM, Javier Viguera<[email protected]> wrote:
>> Can you send me the strace output of Ubuntu's ping?
>>
>> strace -o LOGFILE -s99 ping -c3 -I eth1 192.168.105.1
>>
>> --
>> vda
>
> Hi Denys,
>
> Find it attached.

> socket(PF_INET, SOCK_RAW, IPPROTO_ICMP) = 3
> getuid32()                              = 0
> setuid32(0)                             = 0
> socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
> setsockopt(4, SOL_SOCKET, SO_BINDTODEVICE, "eth1\0", 5) = 0
> connect(4, {sa_family=AF_INET, sin_port=htons(1025),
> sin_addr=inet_addr("192.168.105.1")}, 16) = 0
> getsockname(4, {sa_family=AF_INET, sin_port=htons(57698),
> sin_addr=inet_addr("192.168.105.1")}, [16]) = 0
> close(4)                                = 0

Huh? They closed the socket they bound to eth1.
And then they will use fd 3, which is not bound to eth1.

Seems that it just ignores -I IFACE.
I wonder whether "ping -c3 -I lo <not_your_own_ip>"
will work?

> ioctl(3, SIOCGIFINDEX, {ifr_name="eth1", ifr_index=3}) = 0
....
> sendmsg(3, {msg_name(16)={sa_family=AF_INET, sin_port=htons(0),
> sin_addr=inet_addr("192.168.105.1")}, msg_iov(1)=[{"\10\0\26\272y\37\0\1b
> _J\255\267\16\0\10\t\n\v\f\r\16\17\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37
> !\"#$%&\'()*+,-./01234567", 64}], msg_controllen=24, {cmsg_len=24,
> cmsg_level=SOL_IP, cmsg_type=, ...}, msg_flags=0}, 0) = 64

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
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to