diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2017-06-06 17:37:41 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2017-06-06 17:37:41 +0200 |
commit | 326452238a0f2610b778678fd639730c7bdd40fb (patch) | |
tree | fe95eb5109b8c696274e873b4922fc5562c6a64c /ospf6d/ospf6_area.c | |
parent | Merge pull request #648 from qlyoung/fix-pollfd-stack-overflow (diff) | |
parent | Merge branch 'frr/pull/672' into stable/3.0 (diff) | |
download | frr-326452238a0f2610b778678fd639730c7bdd40fb.tar.xz frr-326452238a0f2610b778678fd639730c7bdd40fb.zip |
Merge branch 'stable/3.0'
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'ospf6d/ospf6_area.c')
-rw-r--r-- | ospf6d/ospf6_area.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c index e652a71bb..deb2c0770 100644 --- a/ospf6d/ospf6_area.c +++ b/ospf6d/ospf6_area.c @@ -619,21 +619,23 @@ DEFUN (area_filter_list, "Filter networks sent to this area\n" "Filter networks sent from this area\n") { - int idx_ipv4 = 1; - int idx_word = 4; + char *inout = argv[argc - 1]->text; + char *areaid = argv[1]->arg; + char *plistname = argv[4]->arg; + struct ospf6_area *area; struct prefix_list *plist; - OSPF6_CMD_AREA_GET (argv[idx_ipv4]->arg, area); + OSPF6_CMD_AREA_GET (areaid, area); - plist = prefix_list_lookup (AFI_IP6, argv[idx_ipv4]->arg); - if (strncmp (argv[idx_word]->arg, "in", 2) == 0) + plist = prefix_list_lookup (AFI_IP6, plistname); + if (strmatch (inout, "in")) { PREFIX_LIST_IN (area) = plist; if (PREFIX_NAME_IN (area)) free (PREFIX_NAME_IN (area)); - PREFIX_NAME_IN (area) = strdup (argv[idx_ipv4]->arg); + PREFIX_NAME_IN (area) = strdup (plistname); ospf6_abr_reimport (area); } else @@ -642,7 +644,7 @@ DEFUN (area_filter_list, if (PREFIX_NAME_OUT (area)) free (PREFIX_NAME_OUT (area)); - PREFIX_NAME_OUT (area) = strdup (argv[idx_ipv4]->arg); + PREFIX_NAME_OUT (area) = strdup (plistname); ospf6_abr_enable_area (area); } @@ -661,16 +663,18 @@ DEFUN (no_area_filter_list, "Filter networks sent to this area\n" "Filter networks sent from this area\n") { - int idx_ipv4 = 2; - int idx_word = 5; + char *inout = argv[argc - 1]->text; + char *areaid = argv[2]->arg; + char *plistname = argv[5]->arg; + struct ospf6_area *area; - OSPF6_CMD_AREA_GET (argv[idx_ipv4]->arg, area); + OSPF6_CMD_AREA_GET (areaid, area); - if (strncmp (argv[idx_word]->arg, "in", 2) == 0) + if (strmatch (inout, "in")) { if (PREFIX_NAME_IN (area)) - if (strcmp (PREFIX_NAME_IN (area), argv[idx_ipv4]->arg) != 0) + if (!strmatch (PREFIX_NAME_IN (area), plistname)) return CMD_SUCCESS; PREFIX_LIST_IN (area) = NULL; @@ -683,7 +687,7 @@ DEFUN (no_area_filter_list, else { if (PREFIX_NAME_OUT (area)) - if (strcmp (PREFIX_NAME_OUT (area), argv[idx_ipv4]->arg) != 0) + if (!strmatch (PREFIX_NAME_OUT (area), plistname)) return CMD_SUCCESS; PREFIX_LIST_OUT (area) = NULL; |