• Paolo Abeni's avatar
    lwtunnel: fix argument parsing · f0df4081
    Paolo Abeni authored
    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: 1e529305 ("lwtunnel: Add encapsulation support to ip route")
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    f0df4081
iproute_lwtunnel.c 6.1 KB