mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 23:29:46 +00:00
net: ipv4: Fix NULL pointer dereference in route lookup
When calculating the multipath hash for input routes the flow info is not available and therefore should not be used. Fixes: 24ba14406c5c ("route: Add multipath_hash in flowi_common to make user-define hash") Signed-off-by: Ido Schimmel <idosch@mellanox.com> Cc: wenxu <wenxu@ucloud.cn> Acked-by: wenxu <wenxu@ucloud.cn> Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
04c2632a6c
commit
2a8e4997db
@ -1820,7 +1820,7 @@ out:
|
|||||||
int fib_multipath_hash(const struct net *net, const struct flowi4 *fl4,
|
int fib_multipath_hash(const struct net *net, const struct flowi4 *fl4,
|
||||||
const struct sk_buff *skb, struct flow_keys *flkeys)
|
const struct sk_buff *skb, struct flow_keys *flkeys)
|
||||||
{
|
{
|
||||||
u32 multipath_hash = fl4->flowi4_multipath_hash;
|
u32 multipath_hash = fl4 ? fl4->flowi4_multipath_hash : 0;
|
||||||
struct flow_keys hash_keys;
|
struct flow_keys hash_keys;
|
||||||
u32 mhash;
|
u32 mhash;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user