[PATCH] ip: Fix command line option parsing of "ip route get ..."

Christian Hornung chhornung at googlemail.com
Wed Nov 3 13:08:00 UTC 2010


Hi,
I found and fixed a bug in the command line options parsing of "ip route get":
It was impossible to get any option other than the IP address
recognized correctly, and e.g. the command "ip route get connected"
just hung up infinitely in the options parsing loop instead of
printing an error message.

Best regards,
Christian Hornung

---
 networking/libiproute/iproute.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index f66774a..f6071b4 100644
--- a/networking/libiproute/iproute.c
+++ b/networking/libiproute/iproute.c
@@ -788,8 +788,8 @@ static int iproute_get(char **argv)
 				}
 				req.r.rtm_dst_len = addr.bitlen;
 			}
-			argv++;
 		}
+		argv++;
 	}

 	if (req.r.rtm_dst_len == 0) {
-- 
1.7.0.4


More information about the busybox mailing list