From: Quentin Young Date: Thu, 6 Oct 2016 04:08:34 +0000 (+0000) Subject: zebra: Fix static route helper function X-Git-Tag: frr-3.0-branchpoint~129^2~90 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=3c2caef9fd680437c9b85b91928b7fe6ef2a0905;p=mirror%2Ffrr.git zebra: Fix static route helper function Signed-off-by: Quentin Young --- diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index d755562759..b3164839fa 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -312,25 +312,25 @@ zebra_vty_ip_route_tdv_helper (int argc, struct cmd_token *argv[], int idx_curr, char **tag, char **distance, char **vrf) { - if (argc > idx_curr) - { - if (strmatch (argv[idx_curr]->text, "tag")) - { - *tag = argv[idx_curr]->arg; - idx_curr++; - } - - if (strmatch (argv[idx_curr]->text, "vrf")) - { - *distance = NULL; - *vrf = argv[idx_curr]->arg; - } - else - { - *distance = argv[idx_curr]->arg; - *vrf = argv[++idx_curr]->arg; - } - } + *distance = NULL; + while (idx_curr < argc) + { + if (strmatch (argv[idx_curr]->text, "tag")) + { + *tag = argv[idx_curr+1]->arg; + idx_curr += 2; + } + else if (strmatch (argv[idx_curr]->text, "vrf")) + { + *vrf = argv[idx_curr+1]->arg; + idx_curr += 2; + } + else + { + *distance = argv[idx_curr]->arg; + idx_curr++; + } + } return; }