]> git.ipfire.org Git - thirdparty/iproute2.git/commit
lwtunnel: fix argument parsing
authorPaolo Abeni <pabeni@redhat.com>
Tue, 15 Dec 2015 11:18:04 +0000 (12:18 +0100)
committerStephen Hemminger <shemming@brocade.com>
Fri, 18 Dec 2015 01:16:02 +0000 (17:16 -0800)
commitf0df40810f1c0bc86cf1fcb6f660b0fd9912b1d3
tree292d713bd4fc3de33c50697c021e518ba9c2bb56
parented6b8652f7d5470cac7fd763b4a47d07a3a0bfb6
lwtunnel: fix argument parsing

Currently parse_encap_ip() does not update correctly argv/argc;
if multiple lwtunnel arguments are provided, the parsing fails after
the first one, i.e.

 ip route add 172.16.101.0/24 dev vxlan1 encap ip id 42 dst 192.168.255.1

fails with:

 Error: either "to" is duplicate, or "dst" is a garbage.

This commit addresses the issue, stepping to next argument at each iteration
of the parsing loop.

Fixes: 1e5293056a02 ("lwtunnel: Add encapsulation support to ip route")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
ip/iproute_lwtunnel.c