diff options
author | David Ahern <dsahern@gmail.com> | 2020-09-13 12:43:39 -0600 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-09-14 14:54:56 -0700 |
commit | 1869e226a7b3ef75b4f70ede2f1b7229f7157fa4 (patch) | |
tree | ed7271a67ee76860e82aa3fbd27b2d9f42c480c2 /net/core | |
parent | 9d6e0c8b707b1f29f3d4e03714a72fffb417d144 (diff) | |
download | linux-1869e226a7b3ef75b4f70ede2f1b7229f7157fa4.tar.gz linux-1869e226a7b3ef75b4f70ede2f1b7229f7157fa4.tar.bz2 linux-1869e226a7b3ef75b4f70ede2f1b7229f7157fa4.zip |
ipv4: Initialize flowi4_multipath_hash in data path
flowi4_multipath_hash was added by the commit referenced below for
tunnels. Unfortunately, the patch did not initialize the new field
for several fast path lookups that do not initialize the entire flow
struct to 0. Fix those locations. Currently, flowi4_multipath_hash
is random garbage and affects the hash value computed by
fib_multipath_hash for multipath selection.
Fixes: 24ba14406c5c ("route: Add multipath_hash in flowi_common to make user-define hash")
Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: wenxu <wenxu@ucloud.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/filter.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/core/filter.c b/net/core/filter.c index 1f647ab986b6..1b168371ba96 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -4838,6 +4838,7 @@ static int bpf_ipv4_fib_lookup(struct net *net, struct bpf_fib_lookup *params, fl4.saddr = params->ipv4_src; fl4.fl4_sport = params->sport; fl4.fl4_dport = params->dport; + fl4.flowi4_multipath_hash = 0; if (flags & BPF_FIB_LOOKUP_DIRECT) { u32 tbid = l3mdev_fib_table_rcu(dev) ? : RT_TABLE_MAIN; |