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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110603083918.GA15883@one.firstfloor.org>
Date:	Fri, 3 Jun 2011 10:39:18 +0200
From:	Andi Kleen <andi@...stfloor.org>
To:	shemminger@...ux-foundation.org, netdev@...r.kernel.org
Subject: [PATCH] iproute: Ignore all output fields of ip route get for route add

My vpnc-connect script broke in a kernel release because the new
kernel started returning the ipid in ip cache get. The script
would do ip route get, modify the route and then feed it back
to ip route add. But ip route add couldn't parse ipid ..

Make route add skip all status fields output by ip cache get

In theory they could be fed to the kernel too, but that's likely
not very useful (and I'm not fully sure if the kernel would
even use them)

Signed-off-by: Andi Kleen <ak@...ux.intel.com>

diff --git a/ip/iproute.c b/ip/iproute.c
index 2fef35b..8b7421e 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -936,6 +936,17 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
 			   strcmp(*argv, "oif") == 0) {
 			NEXT_ARG();
 			d = *argv;
+		/* Ignore everything else printed by ip route get. */
+		} else if (strcmp(*argv, "ipid") == 0 ||
+			   strcmp(*argv, "ts") == 0 ||
+			   strcmp(*argv, "tsage") == 0 ||
+			   strcmp(*argv, "age") == 0 ||
+			   strcmp(*argv, "used") == 0 ||
+			   strcmp(*argv, "users") == 0 ||
+			   strcmp(*argv, "error") == 0 ||
+			   strcmp(*argv, "cache") == 0 ||
+			   strcmp(*argv, "expires") == 0) {
+			NEXT_ARG();
 		} else {
 			int type;
 			inet_prefix dst;
-- 
ak@...ux.intel.com -- Speaking for myself only.
--
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