]> git.baikalelectronics.ru Git - kernel.git/commit
vxlan: don't allow overwrite of config src addr
authorBrian Russell <brussell@brocade.com>
Fri, 24 Feb 2017 17:47:11 +0000 (17:47 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 24 Feb 2017 18:36:24 +0000 (13:36 -0500)
commit3f89ad1063db9b05925cc8c50cab4a07c58ce031
tree26189ec44a8a0f60e880985a9bfb7fc1c3b89896
parent9ca9682f369fe79ce997f5917cc4de60035643e7
vxlan: don't allow overwrite of config src addr

When using IPv6 transport and a default dst, a pointer to the configured
source address is passed into the route lookup. If no source address is
configured, then the value is overwritten.

IPv6 route lookup ignores egress ifindex match if the source address is set,
so if egress ifindex match is desired, the source address must be passed
as any. The overwrite breaks this for subsequent lookups.

Avoid this by copying the configured address to an existing stack variable
and pass a pointer to that instead.

Fixes: 96eb029d59cb ("net: vxlan: lwt: Use source ip address during route lookup.")
Signed-off-by: Brian Russell <brussell@brocade.com>
Acked-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan.c