[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250401020017.96438-1-shaozhengchao@163.com>
Date: Tue, 1 Apr 2025 10:00:17 +0800
From: shaozhengchao@....com
To: netdev@...r.kernel.org,
davem@...emloft.net,
dsahern@...nel.org,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com
Cc: horms@...nel.org,
shaozhengchao@....com
Subject: [PATCH net-next] ipv4: remove unnecessary judgment in ip_route_output_key_hash_rcu
From: Zhengchao Shao <shaozhengchao@....com>
In the ip_route_output_key_cash_rcu function, the input fl4 member saddr is
first checked to be non-zero before entering multicast, broadcast and
arbitrary IP address checks. However, the fact that the IP address is not
0 has already ruled out the possibility of any address, so remove
unnecessary judgment.
Signed-off-by: Zhengchao Shao <shaozhengchao@....com>
---
net/ipv4/route.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 753704f75b2c..22dfc971aab4 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2699,8 +2699,7 @@ struct rtable *ip_route_output_key_hash_rcu(struct net *net, struct flowi4 *fl4,
if (fl4->saddr) {
if (ipv4_is_multicast(fl4->saddr) ||
- ipv4_is_lbcast(fl4->saddr) ||
- ipv4_is_zeronet(fl4->saddr)) {
+ ipv4_is_lbcast(fl4->saddr)) {
rth = ERR_PTR(-EINVAL);
goto out;
}
--
2.43.0
Powered by blists - more mailing lists