Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1266978

ipv4: ip unreachable with SO_BINDTODEVICE socket

From Kouya Shimura <kouya@jp.fujitsu.com>
Newsgroups linux.kernel
Subject ipv4: ip unreachable with SO_BINDTODEVICE socket
Date 2015-11-11 07:10 +0100
Message-ID <qtwLw-7rg-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi

When both server and client are on the same machine and each their
socket option is set to SO_BINDTODEVICE, sometimes a packet doesn't
reach to the server.

The reproducible test program is attached. (modify "IF_ADDR=, IP_ADDR=,
PORT=" lines appropriately).  Please try 'taskset -c 1 python test.py'
since per cpu data (rt_cache) affects results.  Also 'tcpdump -i lo'
is helpful for testing.  you can see "ICMP udp port unreachable".

In this test program, a packet doesn't pass through the bound
interface but 'lo' interface. So, it might be granted that local
communication with SO_BINDTODEVICE socket fails. However, dnsmasq and
dhcp_release commands rely on it (Actually I've found this issue on
the OpenStack envirionment) and the test program works well on
linux-2.6.32 but doesn't work on linux-3.10.0 and 4.3.0.

I'd like to know whether this is a kernel bug or the specification of
SO_BINDTODEVICE.

The attached patch fixes this issue, but no confidence this is a
right modification.

Thanks,
Kouya

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

ipv4: ip unreachable with SO_BINDTODEVICE socket Kouya Shimura <kouya@jp.fujitsu.com> - 2015-11-11 07:10 +0100
  Re: ipv4: ip unreachable with SO_BINDTODEVICE socket Julian Anastasov <ja@ssi.bg> - 2015-11-12 00:00 +0100

csiph-web