diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 670e6f3df5893adc1a68f9d5616ea1a837a01fe1..a2621b5af1fd4a1f213ba6e0d61517b713367f85 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -2374,14 +2374,17 @@ struct rtable *ip_route_output_key_hash_rcu(struct net *net, struct flowi4 *fl4, int orig_oif = fl4->flowi4_oif; unsigned int flags = 0; struct rtable *rth; - int err = -ENETUNREACH; + int err; if (fl4->saddr) { - rth = ERR_PTR(-EINVAL); if (ipv4_is_multicast(fl4->saddr) || ipv4_is_lbcast(fl4->saddr) || - ipv4_is_zeronet(fl4->saddr)) + ipv4_is_zeronet(fl4->saddr)) { + rth = ERR_PTR(-EINVAL); goto out; + } + + rth = ERR_PTR(-ENETUNREACH); /* I removed check for oif == dev_out->oif here. It was wrong for two reasons: