summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2018-02-21 11:00:54 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-08 22:41:15 -0800
commit97ba6e5ff68454320695d1372d035c624b66c4ba (patch)
tree608c5f5bdd2ab86662ff1fea4c6ab2821f82eafb /net
parent73cb791fe41cdffda6f26aa0559dc17c11d0ee38 (diff)
downloadlinux-stable-97ba6e5ff68454320695d1372d035c624b66c4ba.tar.gz
linux-stable-97ba6e5ff68454320695d1372d035c624b66c4ba.tar.bz2
linux-stable-97ba6e5ff68454320695d1372d035c624b66c4ba.zip
net: ipv4: Set addr_type in hash_keys for forwarded case
[ Upstream commit 1fe4b1184c2ae2bfbf9e8b14c9c0c1945c98f205 ] The result of the skb flow dissect is copied from keys to hash_keys to ensure only the intended data is hashed. The original L4 hash patch overlooked setting the addr_type for this case; add it. Fixes: bf4e0a3db97eb ("net: ipv4: add support for ECMP hash policy choice") Reported-by: Ido Schimmel <idosch@idosch.org> Signed-off-by: David Ahern <dsahern@gmail.com> Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/route.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index f4ad8fda8d9a..9ff06c5051ae 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1832,6 +1832,8 @@ int fib_multipath_hash(const struct fib_info *fi, const struct flowi4 *fl4,
return skb_get_hash_raw(skb) >> 1;
memset(&hash_keys, 0, sizeof(hash_keys));
skb_flow_dissect_flow_keys(skb, &keys, flag);
+
+ hash_keys.control.addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS;
hash_keys.addrs.v4addrs.src = keys.addrs.v4addrs.src;
hash_keys.addrs.v4addrs.dst = keys.addrs.v4addrs.dst;
hash_keys.ports.src = keys.ports.src;