[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <a9569cddcdeb5f0b7d138a22086f76f1b9e5acd5.1444754404.git.lucien.xin@gmail.com>
Date: Wed, 14 Oct 2015 00:40:04 +0800
From: Xin Long <lucien.xin@...il.com>
To: network dev <netdev@...r.kernel.org>
Cc: davem@...emloft.net, fw@...len.de
Subject: [PATCH net-next] route: fib_validate_source remove the <= RT_SCOPE_HOST test
commit fe3edf45792a ("ipv4: Remove all RTCF_DIRECTSRC handliing.").
Before this commit, we had a tristate:
< 0: error
0: ok
1: ok and set RTCF_DIRECTSRC
But now we only care about 0 or < 0.
Signed-off-by: Xin Long <lucien.xin@...il.com>
---
net/ipv4/fib_frontend.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index d7c2bb0..f5c74d8 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -376,22 +376,14 @@ static int __fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst,
if (FIB_RES_DEV(res) == dev)
dev_match = true;
#endif
- if (dev_match) {
- ret = FIB_RES_NH(res).nh_scope >= RT_SCOPE_HOST;
- return ret;
- }
+ if (dev_match)
+ return 0;
if (no_addr)
goto last_resort;
if (rpf == 1)
goto e_rpf;
- fl4.flowi4_oif = dev->ifindex;
- ret = 0;
- if (fib_lookup(net, &fl4, &res, FIB_LOOKUP_IGNORE_LINKSTATE) == 0) {
- if (res.type == RTN_UNICAST)
- ret = FIB_RES_NH(res).nh_scope >= RT_SCOPE_HOST;
- }
- return ret;
+ return 0;
last_resort:
if (rpf)
--
2.1.0
--
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