[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1411982198-17416-1-git-send-email-roy.qing.li@gmail.com>
Date: Mon, 29 Sep 2014 17:16:38 +0800
From: roy.qing.li@...il.com
To: netdev@...r.kernel.org
Subject: [PATCH][net-next] ipv4: unnecessary to set err on no_route path
From: Li RongQing <roy.qing.li@...il.com>
When the code skips to no_route label, it will skip to local_input at last,
then err will be reset on the local_input path before exit function.
Signed-off-by: Li RongQing <roy.qing.li@...il.com>
---
net/ipv4/route.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index d4bd68d..403914b 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1704,11 +1704,9 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
fl4.daddr = daddr;
fl4.saddr = saddr;
err = fib_lookup(net, &fl4, &res);
- if (err != 0) {
- if (!IN_DEV_FORWARD(in_dev))
- err = -EHOSTUNREACH;
+ if (err != 0)
goto no_route;
- }
+
if (res.type == RTN_BROADCAST)
goto brd_input;
@@ -1721,10 +1719,9 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
goto local_input;
}
- if (!IN_DEV_FORWARD(in_dev)) {
- err = -EHOSTUNREACH;
+ if (!IN_DEV_FORWARD(in_dev))
goto no_route;
- }
+
if (res.type != RTN_UNICAST)
goto martian_destination;
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists