]> 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)
commit9f0786a57a8303162efc00ecdf64c6c2e4b92cba
tree26189ec44a8a0f60e880985a9bfb7fc1c3b89896
parent846b72e37ced6214ab4c10b42f739615ed004213
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: 65e85c4a3f1b ("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