ip: Fix command line option parsing of "ip route get ..."
authorChristian Hornung <chhornung@googlemail.com>
Wed, 3 Nov 2010 13:08:00 +0000 (14:08 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 4 Nov 2010 07:59:42 +0000 (08:59 +0100)
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.

Signed-off-by: Christian Hornung <chhornung@googlemail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/libiproute/iproute.c

index f66774afe1613027370b1ee94f512b6afbd5e947..f6071b463455bad4bc76a645aa629558602289d1 100644 (file)
@@ -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) {