]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: send arp replies to the correct tunnel
authorJiri Benc <jbenc@redhat.com>
Tue, 22 Sep 2015 16:12:11 +0000 (18:12 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Sep 2015 21:31:36 +0000 (14:31 -0700)
commite54dc68016f4ddcdfb87f05d1b5ed33902bf2956
tree3122aaf73744bc976113cffb2367b4e770b901f8
parent2031cb530c0601ecede0d5e9f149ace4b5be4341
ipv4: send arp replies to the correct tunnel

When using ip lwtunnels, the additional data for xmit (basically, the actual
tunnel to use) are carried in ip_tunnel_info either in dst->lwtstate or in
metadata dst. When replying to ARP requests, we need to send the reply to
the same tunnel the request came from. This means we need to construct
proper metadata dst for ARP replies.

We could perform another route lookup to get a dst entry with the correct
lwtstate. However, this won't always ensure that the outgoing tunnel is the
same as the incoming one, and it won't work anyway for IPv4 duplicate
address detection.

The only thing to do is to "reverse" the ip_tunnel_info.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ip_tunnels.h
net/ipv4/arp.c
net/ipv4/ip_tunnel_core.c