diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-04-27 22:04:56 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-04-28 10:55:45 -0400 | 
| commit | 30a24af0925868211df83ff2c4a06acd874cdf5c (patch) | |
| tree | 40fd2206bafef26d6ed00493dc98039c114cf57c /ospf6d/ospf6d.c | |
| parent | 373886aba91b963111b13bf01521a7680c5ffee9 (diff) | |
ospf6d: Fix parse_type_spec
The function parse_type_spec was always looking in argv[0] of
for figuring out the type of the command.  Since the type location
could change, use the passed in idx_lsa.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'ospf6d/ospf6d.c')
| -rw-r--r-- | ospf6d/ospf6d.c | 14 | 
1 files changed, 7 insertions, 7 deletions
diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c index b067a66e27..aa219c7807 100644 --- a/ospf6d/ospf6d.c +++ b/ospf6d/ospf6d.c @@ -147,19 +147,19 @@ parse_type_spec (int idx_lsa, int argc, struct cmd_token **argv)    if (argc > idx_lsa)      { -      if (strmatch (argv[0]->text, "router")) +      if (strmatch (argv[idx_lsa]->text, "router"))          type = htons (OSPF6_LSTYPE_ROUTER); -      else if (strmatch (argv[0]->text, "network")) +      else if (strmatch (argv[idx_lsa]->text, "network"))          type = htons (OSPF6_LSTYPE_NETWORK); -      else if (strmatch (argv[0]->text, "as-external")) +      else if (strmatch (argv[idx_lsa]->text, "as-external"))          type = htons (OSPF6_LSTYPE_AS_EXTERNAL); -      else if (strmatch (argv[0]->text, "intra-prefix")) +      else if (strmatch (argv[idx_lsa]->text, "intra-prefix"))          type = htons (OSPF6_LSTYPE_INTRA_PREFIX); -      else if (strmatch (argv[0]->text, "inter-router")) +      else if (strmatch (argv[idx_lsa]->text, "inter-router"))          type = htons (OSPF6_LSTYPE_INTER_ROUTER); -      else if (strmatch (argv[0]->text, "inter-prefix")) +      else if (strmatch (argv[idx_lsa]->text, "inter-prefix"))          type = htons (OSPF6_LSTYPE_INTER_PREFIX); -      else if (strmatch (argv[0]->text, "link")) +      else if (strmatch (argv[idx_lsa]->text, "link"))          type = htons (OSPF6_LSTYPE_LINK);      }  | 
