lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sun,  6 Jul 2014 19:01:51 +0800
From:	Xin Long <lucien.xin@...il.com>
To:	network dev <netdev@...r.kernel.org>
Cc:	Xin Long <lucien.xin@...il.com>
Subject: [PATCH] return the right retcode when add a unreachable route

when add a route like this:
ip route add 74.125.31.199 dev eth0 via 1.2.3.4 ,
1.2.3.4 is a unreachable ip, it return -ENETUNREACH, it is ok.
but before that I add a rule:
ip rule add fwmark 1 lookup 101 ,
then add that route , it will return -ESRCH.

Signed-off-by: Xin Long <lucien.xin@...il.com>
---
 include/net/ip_fib.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 9922093..cfc2293 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -261,7 +261,9 @@ static inline int fib_lookup(struct net *net, struct flowi4 *flp,
 			return 0;
 		return -ENETUNREACH;
 	}
-	return __fib_lookup(net, flp, res);
+	if(__fib_lookup(net, flp, res))
+		return -ENETUNREACH;
+	return 0;
 }
 
 #endif /* CONFIG_IP_MULTIPLE_TABLES */
-- 
1.8.3.1

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ