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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2017 11:43:31 +0000 (12:43 +0100)
commita64407fafe09ca33b09aabd49c5d526b1b6b7528
treea2c6daf8fc9b6e1f8aafde14ea48dcf29b341fad
parentf7081057d12c0cb50a84869bae03fb9d406037f0
vxlan: don't allow overwrite of config src addr

[ Upstream commit 1158632b5a2dcce0786c1b1b99654e81cc867981 ]

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: 272d96a5ab10 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/vxlan.c