Skip to content

Commit e702b29

Browse files
shaozhengchaoNipaLocal
authored and
NipaLocal
committed
ipv4: remove unnecessary judgment in ip_route_output_key_hash_rcu
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 <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 4803b0b commit e702b29

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

net/ipv4/route.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2699,8 +2699,7 @@ struct rtable *ip_route_output_key_hash_rcu(struct net *net, struct flowi4 *fl4,
26992699

27002700
if (fl4->saddr) {
27012701
if (ipv4_is_multicast(fl4->saddr) ||
2702-
ipv4_is_lbcast(fl4->saddr) ||
2703-
ipv4_is_zeronet(fl4->saddr)) {
2702+
ipv4_is_lbcast(fl4->saddr)) {
27042703
rth = ERR_PTR(-EINVAL);
27052704
goto out;
27062705
}

0 commit comments

Comments
 (0)