[Bug 9346] ping -I br0 <ip of br0> doesn't work

bugzilla at busybox.net bugzilla at busybox.net
Mon Dec 12 18:03:46 UTC 2016


https://bugs.busybox.net/show_bug.cgi?id=9346

--- Comment #3 from Denys Vlasenko <vda.linux at googlemail.com> ---
(In reply to Markus Gothe from comment #2)
Ok, I was wrong: I tried it without -I br0. With -I br0, bbox ping fails for me
too.

And it's probably not a bug.

Pinging (one of) your own IP does not go over any physical interface, it goes
over loopback: kernel definitely doesn't send any packets over the network, it
simply feeds TX packet back to RX code.

Tried "ping -I lo" in your case and it works.

Now, why iputils works? bbox code does

setsockopt(0, SOL_SOCKET, SO_BINDTODEVICE, "br\0\0\0", 32)

to instruct kernel to use a specific iface. iputils does:

setsockopt(5, SOL_SOCKET, SO_BINDTODEVICE, [3175010], 4)

See that 4? This is not a correct length for this setsockopt!
(3175010 is a misdecoded string "br0\0"). This setsockop has no effect, kernel
still will use whichever iface it wants.

Proof: try "ping -I eth0": it will still "successcully" ping br0's IP!

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list