]> git.baikalelectronics.ru Git - kernel.git/commit
net/ipv4: swap flow ports when validating source
authorMiao Wang <shankerwangmiao@gmail.com>
Tue, 22 Jun 2021 04:24:50 +0000 (12:24 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 22 Jun 2021 17:33:04 +0000 (10:33 -0700)
commitb3f4e6f795c9f4176eb17a01ec4bd6edd9072719
tree0886e2a99c19f94e8dbc1f6b0810205dbc72d0bc
parentadf4c997a67f3b6304d6e367b03a4f7a53907499
net/ipv4: swap flow ports when validating source

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: 2e592a217b66 ("net/ipv4: Initialize proto and ports in flow struct")
Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_frontend.c