Commit 584505aa authored by Miao Wang's avatar Miao Wang Committed by Yang Yingliang
Browse files

net/ipv4: swap flow ports when validating source



stable inclusion
from linux-4.19.198
commit 0cb6b100b869164dcd4b48e8c236e0a9f1c8c0ad

--------------------------------

[ Upstream commit c69f114d ]

When doing source address validation, the flowi4 struct used for
fib_lookup should be in the reverse direction to the given skb.
fl4_dport and fl4_sport returned by fib4_rules_early_flow_dissect
should thus be swapped.

Fixes: 5a847a6e ("net/ipv4: Initialize proto and ports in flow struct")
Signed-off-by: default avatarMiao Wang <shankerwangmiao@gmail.com>
Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent f946cf1e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment