]> git.proxmox.com Git - mirror_frr.git/commitdiff
*: use ->text and strmatch where appropriate
authorQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 26 Jun 2017 18:15:19 +0000 (18:15 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 27 Jun 2017 17:46:42 +0000 (17:46 +0000)
Still need to go fix all the places where we do a 1-char strncmp...

spatch follows
------------------

@asdf@
expression idx;
@@
<...
 strcmp (
- argv[idx]->arg,
+ argv[idx]->text,
  ...)
...>

@depends on asdf@
expression idx;
@@
<...
- !strcmp (argv[idx]->text,
+ strmatch (argv[idx]->text,
           ...)
...>

@depends on asdf@
expression idx;
expression arg;
@@
<...
- strcmp (argv[idx]->text, arg) == 0
+ strmatch (argv[idx]->text, arg)
...>

@depends on asdf@
expression idx;
expression arg;
@@
<...
- strcmp (argv[idx]->text, arg) != 0
+ !strmatch (argv[idx]->text, arg)
...>

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
14 files changed:
bgpd/bgp_bfd.c
bgpd/bgp_dump.c
bgpd/bgp_route.c
bgpd/rfapi/bgp_rfapi_cfg.c
bgpd/rfapi/rfapi.c
bgpd/rfapi/rfapi_vty.c
bgpd/rfapi/vnc_debug.c
isisd/isis_spf.c
lib/command.c
nhrpd/nhrp_vty.c
ospf6d/ospf6_lsa.c
ospf6d/ospf6_route.c
ospfd/ospf_vty.c
zebra/zebra_vty.c

index 08cdee76f3d21e474e2a972f3af37f8549f1314f..bc0b80cde46723e63bcc13100e977b352f8ba099 100644 (file)
@@ -629,9 +629,9 @@ DEFUN_HIDDEN (neighbor_bfd_type,
   if (!peer)
     return CMD_WARNING;
 
-  if (!strcmp(argv[idx_hop]->arg, "singlehop"))
+  if (strmatch(argv[idx_hop]->text, "singlehop"))
     type = BFD_TYPE_SINGLEHOP;
-  else if (!strcmp(argv[idx_hop]->arg, "multihop"))
+  else if (strmatch(argv[idx_hop]->text, "multihop"))
     type = BFD_TYPE_MULTIHOP;
   else
     return CMD_WARNING;
index bf26fddf9c038f02bce8084aa77d0e5b5f8dd0db..31f9141a8d713228da6687059ad1941c7db619f0 100644 (file)
@@ -753,7 +753,7 @@ DEFUN (dump_bgp_all,
   const struct bgp_dump_type_map *map = NULL;
 
   for (map = bgp_dump_type_map; map->str; map++)
-    if (strcmp(argv[idx_dump_routes]->arg, map->str) == 0)
+    if (strmatch(argv[idx_dump_routes]->text, map->str))
       bgp_dump_type = map->type;
 
   switch (bgp_dump_type)
@@ -800,7 +800,7 @@ DEFUN (no_dump_bgp_all,
   struct bgp_dump *bgp_dump_struct = NULL;
 
   for (map = bgp_dump_type_map; map->str; map++)
-    if (strcmp(argv[idx_dump_routes]->arg, map->str) == 0)
+    if (strmatch(argv[idx_dump_routes]->text, map->str))
       bgp_dump_type = map->type;
 
   switch (bgp_dump_type)
index e7eb7b6d2f715fde4e1d5f66bca5fa522801f04d..a9e4c0d508bf3e13c5b5cb4c725ed6293d670e45 100644 (file)
@@ -8867,7 +8867,7 @@ bgp_show_community (struct vty *vty, struct bgp *bgp, int argc,
         buffer_putc (b, ' ');
       else
        {
-         if ((strcmp (argv[i]->arg, "unicast") == 0) || (strcmp (argv[i]->arg, "multicast") == 0))
+         if (strmatch(argv[i]->text, "unicast") || strmatch(argv[i]->text, "multicast"))
            continue;
          first = 1;
        }
index 2caaa5ce3801d0ea25c2acfd02a2306dd5b834a4..c0f87bc8b0d01f353d0b19c09780db6af4b21f97 100644 (file)
@@ -479,7 +479,7 @@ DEFUN (vnc_defaults_l2rd,
   VTY_DECLVAR_CONTEXT(bgp, bgp);
   uint8_t value = 0;
 
-  if (!strcmp (argv[1]->arg, "auto-vn"))
+  if (strmatch(argv[1]->text, "auto-vn"))
     {
       value = 0;
     }
@@ -539,7 +539,7 @@ DEFUN (vnc_defaults_responselifetime,
   if (!h)
     return CMD_WARNING;
 
-  if (!strcmp (argv[1]->arg, "infinite"))
+  if (strmatch(argv[1]->text, "infinite"))
     {
       rspint = RFAPI_INFINITE_LIFETIME;
     }
@@ -1102,7 +1102,7 @@ DEFUN (vnc_redistribute_lifetime,
 
   vnc_redistribute_prechange (bgp);
 
-  if (!strcmp (argv[3]->arg, "infinite"))
+  if (strmatch(argv[3]->text, "infinite"))
     {
       bgp->rfapi_cfg->redist_lifetime = RFAPI_INFINITE_LIFETIME;
     }
@@ -1141,7 +1141,7 @@ DEFUN (vnc_redist_bgpdirect_no_prefixlist,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[3]->arg, "bgp-direct"))
+  if (strmatch(argv[3]->text, "bgp-direct"))
     {
       route_type = ZEBRA_ROUTE_BGP_DIRECT;
     }
@@ -1150,7 +1150,7 @@ DEFUN (vnc_redist_bgpdirect_no_prefixlist,
       route_type = ZEBRA_ROUTE_BGP_DIRECT_EXT;
     }
 
-  if (!strcmp (argv[4]->arg, "ipv4"))
+  if (strmatch(argv[4]->text, "ipv4"))
     {
       afi = AFI_IP;
     }
@@ -1194,7 +1194,7 @@ DEFUN (vnc_redist_bgpdirect_prefixlist,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[2]->arg, "bgp-direct"))
+  if (strmatch(argv[2]->text, "bgp-direct"))
     {
       route_type = ZEBRA_ROUTE_BGP_DIRECT;
     }
@@ -1203,7 +1203,7 @@ DEFUN (vnc_redist_bgpdirect_prefixlist,
       route_type = ZEBRA_ROUTE_BGP_DIRECT_EXT;
     }
 
-  if (!strcmp (argv[3]->arg, "ipv4"))
+  if (strmatch(argv[3]->text, "ipv4"))
     {
       afi = AFI_IP;
     }
@@ -1244,7 +1244,7 @@ DEFUN (vnc_redist_bgpdirect_no_routemap,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[3]->arg, "bgp-direct"))
+  if (strmatch(argv[3]->text, "bgp-direct"))
     {
       route_type = ZEBRA_ROUTE_BGP_DIRECT;
     }
@@ -1284,7 +1284,7 @@ DEFUN (vnc_redist_bgpdirect_routemap,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[2]->arg, "bgp-direct"))
+  if (strmatch(argv[2]->text, "bgp-direct"))
     {
       route_type = ZEBRA_ROUTE_BGP_DIRECT;
     }
@@ -1337,7 +1337,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_prefixlist,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[3]->arg, "ipv4"))
+  if (strmatch(argv[3]->text, "ipv4"))
     {
       afi = AFI_IP;
     }
@@ -1386,7 +1386,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_prefixlist,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[2]->arg, "ipv4"))
+  if (strmatch(argv[2]->text, "ipv4"))
     {
       afi = AFI_IP;
     }
@@ -1804,7 +1804,7 @@ DEFUN (vnc_nve_group_export_no_prefixlist,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[3]->arg, "ipv4"))
+  if (strmatch(argv[3]->text, "ipv4"))
     {
       afi = AFI_IP;
     }
@@ -1816,7 +1816,7 @@ DEFUN (vnc_nve_group_export_no_prefixlist,
   if (argv[2]->arg[0] == 'b')
     {
       if (((argc > 5)
-           && !strcmp (argv[5]->arg, rfg->plist_export_bgp_name[afi]))
+           && strmatch(argv[5]->text, rfg->plist_export_bgp_name[afi]))
           || (argc <= 5))
         {
 
@@ -1831,7 +1831,7 @@ DEFUN (vnc_nve_group_export_no_prefixlist,
   else
     {
       if (((argc > 5)
-           && !strcmp (argv[5]->arg, rfg->plist_export_zebra_name[afi]))
+           && strmatch(argv[5]->text, rfg->plist_export_zebra_name[afi]))
           || (argc <= 5))
         {
           if (rfg->plist_export_zebra_name[afi])
@@ -1873,7 +1873,7 @@ DEFUN (vnc_nve_group_export_prefixlist,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[2]->arg, "ipv4"))
+  if (strmatch(argv[2]->text, "ipv4"))
     {
       afi = AFI_IP;
     }
@@ -1933,7 +1933,7 @@ DEFUN (vnc_nve_group_export_no_routemap,
   if (argv[2]->arg[0] == 'b')
     {
       if (((argc > 4)
-           && !strcmp (argv[4]->arg, rfg->routemap_export_bgp_name))
+           && strmatch(argv[4]->text, rfg->routemap_export_bgp_name))
           || (argc <= 4))
         {
 
@@ -1949,7 +1949,7 @@ DEFUN (vnc_nve_group_export_no_routemap,
   else
     {
       if (((argc > 4)
-           && !strcmp (argv[4]->arg, rfg->routemap_export_zebra_name))
+           && strmatch(argv[4]->text, rfg->routemap_export_zebra_name))
           || (argc <= 4))
         {
           if (rfg->routemap_export_zebra_name)
@@ -2032,7 +2032,7 @@ DEFUN (vnc_nve_export_no_prefixlist,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[4]->arg, "ipv4"))
+  if (strmatch(argv[4]->text, "ipv4"))
     {
       afi = AFI_IP;
     }
@@ -2045,7 +2045,7 @@ DEFUN (vnc_nve_export_no_prefixlist,
     {
       if (((argc > 6)
            && hc->plist_export_bgp_name[afi]
-           && !strcmp (argv[6]->arg, hc->plist_export_bgp_name[afi]))
+           && strmatch(argv[6]->text, hc->plist_export_bgp_name[afi]))
           || (argc <= 6))
         {
 
@@ -2059,7 +2059,7 @@ DEFUN (vnc_nve_export_no_prefixlist,
     {
       if (((argc > 6)
            && hc->plist_export_zebra_name[afi]
-           && !strcmp (argv[6]->arg, hc->plist_export_zebra_name[afi]))
+           && strmatch(argv[6]->text, hc->plist_export_zebra_name[afi]))
           || (argc <= 6))
         {
 
@@ -2094,7 +2094,7 @@ DEFUN (vnc_nve_export_prefixlist,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[3]->arg, "ipv4"))
+  if (strmatch(argv[3]->text, "ipv4"))
     {
       afi = AFI_IP;
     }
@@ -2145,7 +2145,7 @@ DEFUN (vnc_nve_export_no_routemap,
     {
       if (((argc > 5)
            && hc->routemap_export_bgp_name
-           && !strcmp (argv[5]->arg, hc->routemap_export_bgp_name))
+           && strmatch(argv[5]->text, hc->routemap_export_bgp_name))
           || (argc <= 5))
         {
 
@@ -2160,7 +2160,7 @@ DEFUN (vnc_nve_export_no_routemap,
     {
       if (((argc > 5)
            && hc->routemap_export_zebra_name
-           && !strcmp (argv[5]->arg, hc->routemap_export_zebra_name))
+           && strmatch(argv[5]->text, hc->routemap_export_zebra_name))
           || (argc <= 5))
         {
 
@@ -3050,7 +3050,7 @@ DEFUN (vnc_nve_group_l2rd,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[1]->arg, "auto:vn"))
+  if (strmatch(argv[1]->text, "auto:vn"))
     {
       rfg->l2rd = 0;
     }
@@ -3199,7 +3199,7 @@ DEFUN (vnc_nve_group_responselifetime,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[1]->arg, "infinite"))
+  if (strmatch(argv[1]->text, "infinite"))
     {
       rspint = RFAPI_INFINITE_LIFETIME;
     }
index 69fae2ae40ab55bfa164fe308491eb812a9cc16e..32347f186a19cfefd7e9ef677c249d749452e836 100644 (file)
@@ -3333,7 +3333,7 @@ DEFUN (debug_rfapi_register_vn_un,
     }
   rfapiQprefix2Rprefix (&pfx, &hpfx);
 
-  if (!strcmp (argv[10]->arg, "infinite"))
+  if (strmatch(argv[10]->text, "infinite"))
     {
       lifetime = RFAPI_INFINITE_LIFETIME;
     }
@@ -3422,7 +3422,7 @@ DEFUN (debug_rfapi_register_vn_un_l2o,
     }
   rfapiQprefix2Rprefix (&pfx, &hpfx);
 
-  if (!strcmp (argv[10]->arg, "infinite"))
+  if (strmatch(argv[10]->text, "infinite"))
     {
       lifetime = RFAPI_INFINITE_LIFETIME;
     }
@@ -3932,7 +3932,7 @@ DEFUN (debug_rfapi_response_omit_self,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[3]->arg, "on"))
+  if (strmatch(argv[3]->text, "on"))
     SET_FLAG (bgp->rfapi_cfg->flags, BGP_VNC_CONFIG_FILTER_SELF_FROM_RSP);
   else
     UNSET_FLAG (bgp->rfapi_cfg->flags, BGP_VNC_CONFIG_FILTER_SELF_FROM_RSP);
index 7c5d6ce3fab71d0adb396c8852928c9384c462c4..04970eb0a75602358f38790b18101c56f9b8f9c6 100644 (file)
@@ -2236,7 +2236,7 @@ register_add (
 
        for (; argc; --argc, ++argv)
          {
-           if (!strcmp (argv[0]->arg, "local-next-hop"))
+           if (strmatch(argv[0]->text, "local-next-hop"))
              {
                if (arg_lnh)
                  {
@@ -2253,7 +2253,7 @@ register_add (
                ++argv, --argc;
                arg_lnh = argv[0]->arg;
              }
-           if (!strcmp (argv[0]->arg, "local-cost"))
+           if (strmatch(argv[0]->text, "local-cost"))
              {
                if (arg_lnh_cost)
                  {
index cc27277a72b69ef91adb76e7c78e2c85317e905f..27c81d46d63b40cd0373e4ce6f5680dadda13782 100644 (file)
@@ -69,7 +69,7 @@ DEFUN (debug_bgp_vnc,
 
   for (i = 0; i < (sizeof(vncdebug) / sizeof(struct vnc_debug)); ++i)
     {
-      if (!strcmp(argv[3]->arg, vncdebug[i].name))
+      if (strmatch(argv[3]->text, vncdebug[i].name))
        {
          if (vty->node == CONFIG_NODE)
            {
@@ -104,11 +104,11 @@ DEFUN (no_debug_bgp_vnc,
 {
   size_t       i;
 
-  if (!strcmp(argv[0]->arg, "no"))
+  if (strmatch(argv[0]->text, "no"))
     argc--, argv++;
   for (i = 0; i < (sizeof(vncdebug) / sizeof(struct vnc_debug)); ++i)
     {
-      if (!strcmp(argv[3]->arg, vncdebug[i].name))
+      if (strmatch(argv[3]->text, vncdebug[i].name))
        {
          if (vty->node == CONFIG_NODE)
            {
index ca268cec7e3843fa1fa8202f47767824b9a37435..9a1ed32003437ad7cb2a7460d3b40dd8694c59b3 100644 (file)
@@ -1386,7 +1386,7 @@ DEFUN (show_isis_topology,
 
   if (argc < 4)
     levels = ISIS_LEVEL1|ISIS_LEVEL2;
-  else if (!strcmp(argv[3]->arg, "level-1"))
+  else if (strmatch(argv[3]->text, "level-1"))
     levels = ISIS_LEVEL1;
   else
     levels = ISIS_LEVEL2;
index 585371099981692f9e2a6316a8a66d086ea8b20e..b69aeacd63548a0fcb895ef42667d8cea9b9e9d5 100644 (file)
@@ -1534,8 +1534,8 @@ DEFUN (config_write,
   struct stat conf_stat;
 
   // if command was 'write terminal' or 'show running-config'
-  if (argc == 2 && (!strcmp(argv[idx_type]->text, "terminal") ||
-                    !strcmp(argv[0]->text, "show")))
+  if (argc == 2 && (strmatch(argv[idx_type]->text, "terminal") ||
+                    strmatch(argv[0]->text, "show")))
     {
       vty_write_config (vty);
       return CMD_SUCCESS;
index f7c55a7ac465c0d79f751876b567e496d542dff2..2507124c4144f661d35c8e047c7b2d98de236af0 100644 (file)
@@ -493,7 +493,7 @@ DEFUN(if_nhrp_map, if_nhrp_map_cmd,
                return nhrp_vty_return(vty, NHRP_ERR_FAIL);
 
        c->map = 1;
-       if (strcmp(argv[4]->text, "local") == 0) {
+       if (strmatch(argv[4]->text, "local")) {
                nhrp_cache_update_binding(c, NHRP_CACHE_LOCAL, 0, NULL, 0, NULL);
        } else{
                if (str2sockunion(argv[4]->arg, &nbma_addr) < 0)
index acc8fe38040932b35b1884be043cd53dcece2baf..624acb9c6942f481619b12b6151784ad244f6d0a 100644 (file)
@@ -850,11 +850,11 @@ DEFUN (debug_ospf6_lsa_type,
 
   if (argc == 5)
     {
-      if (! strcmp (argv[idx_type]->text, "originate"))
+      if (strmatch(argv[idx_type]->text, "originate"))
         SET_FLAG (handler->debug, OSPF6_LSA_DEBUG_ORIGINATE);
-      else if (! strcmp (argv[idx_type]->text, "examine"))
+      else if (strmatch(argv[idx_type]->text, "examine"))
         SET_FLAG (handler->debug, OSPF6_LSA_DEBUG_EXAMIN);
-      else if (! strcmp (argv[idx_type]->text, "flooding"))
+      else if (strmatch(argv[idx_type]->text, "flooding"))
         SET_FLAG (handler->debug, OSPF6_LSA_DEBUG_FLOOD);
     }
   else
@@ -903,11 +903,11 @@ DEFUN (no_debug_ospf6_lsa_type,
 
   if (argc == 6)
     {
-      if (! strcmp (argv[idx_type]->text, "originate"))
+      if (strmatch(argv[idx_type]->text, "originate"))
         UNSET_FLAG (handler->debug, OSPF6_LSA_DEBUG_ORIGINATE);
-      if (! strcmp (argv[idx_type]->text, "examine"))
+      if (strmatch(argv[idx_type]->text, "examine"))
         UNSET_FLAG (handler->debug, OSPF6_LSA_DEBUG_EXAMIN);
-      if (! strcmp (argv[idx_type]->text, "flooding"))
+      if (strmatch(argv[idx_type]->text, "flooding"))
         UNSET_FLAG (handler->debug, OSPF6_LSA_DEBUG_FLOOD);
     }
   else
index 117f7af6eeee20973af05cc0e7b7a2f688797082..a6bb099ddd25170b286ec0abd8e251d5fa67f865 100644 (file)
@@ -1313,43 +1313,43 @@ ospf6_route_table_show (struct vty *vty, int argc_start, int argc, struct cmd_to
 
   for (i = argc_start; i < argc; i++)
     {
-      if (! strcmp (argv[i]->arg, "summary"))
+      if (strmatch(argv[i]->text, "summary"))
         {
           summary++;
           continue;
         }
 
-      if (! strcmp (argv[i]->arg, "intra-area"))
+      if (strmatch(argv[i]->text, "intra-area"))
         {
           type = OSPF6_PATH_TYPE_INTRA;
           continue;
         }
 
-      if (! strcmp (argv[i]->arg, "inter-area"))
+      if (strmatch(argv[i]->text, "inter-area"))
         {
           type = OSPF6_PATH_TYPE_INTER;
           continue;
         }
 
-      if (! strcmp (argv[i]->arg, "external-1"))
+      if (strmatch(argv[i]->text, "external-1"))
         {
           type = OSPF6_PATH_TYPE_EXTERNAL1;
           continue;
         }
 
-      if (! strcmp (argv[i]->arg, "external-2"))
+      if (strmatch(argv[i]->text, "external-2"))
         {
           type = OSPF6_PATH_TYPE_EXTERNAL2;
           continue;
         }
 
-      if (! strcmp (argv[i]->arg, "detail"))
+      if (strmatch(argv[i]->text, "detail"))
         {
           detail++;
           continue;
         }
 
-      if (! strcmp (argv[i]->arg, "match"))
+      if (strmatch(argv[i]->text, "match"))
         {
           match++;
           continue;
@@ -1488,7 +1488,7 @@ ospf6_linkstate_table_show (struct vty *vty, int idx_ipv4, int argc,
 
   for (i = idx_ipv4; i < argc; i++)
     {
-      if (! strcmp (argv[i]->arg, "detail"))
+      if (strmatch(argv[i]->text, "detail"))
         {
           detail++;
           continue;
index c831b138237e638f14830f64e51c8cfdb5ddd6a4..09994fb2b4fe4bbe2a23b9a7c18afcbef11f4eae 100644 (file)
@@ -374,7 +374,7 @@ DEFUN (ospf_passive_interface,
   struct ospf_if_params *params;
   struct route_node *rn;
 
-  if (strcmp (argv[1]->text, "default") == 0)
+  if (strmatch(argv[1]->text, "default"))
     {
       ospf_passive_interface_default (ospf, OSPF_IF_PASSIVE);
       return CMD_SUCCESS;
@@ -444,7 +444,7 @@ DEFUN (no_ospf_passive_interface,
   int ret;
   struct route_node *rn;
 
-  if (strcmp (argv[2]->text, "default") == 0)
+  if (strmatch(argv[2]->text, "default"))
     {
       ospf_passive_interface_default (ospf, OSPF_IF_ACTIVE);
       return CMD_SUCCESS;
@@ -1090,7 +1090,7 @@ DEFUN (ospf_area_vlink,
                      i++;
                    }
                  else if (strncmp (argv[i+1]->arg, "m", 1) == 0
-                          && strcmp (argv[i+1]->arg, "message-digest-") != 0)
+                          && !strmatch(argv[i + 1]->text, "message-digest-"))
                    {
                      /* "authentication message-digest" */ 
                      vl_config.auth_type = OSPF_AUTH_CRYPTOGRAPHIC;
index 88778e491ba96764e649e0294e86c25d85b2830e..870e365425cc67f56c6e0e5b3b5d0baff8798ec1 100644 (file)
@@ -2185,7 +2185,7 @@ DEFUN (ipv6_route,
   int idx_curr;
   char *src, *tag, *distance, *vrf;
 
-  if (!strcmp(argv[3]->text, "from"))
+  if (strmatch(argv[3]->text, "from"))
     {
       src = argv[4]->arg;
       idx_ipv6_ifname = 5;
@@ -2234,7 +2234,7 @@ DEFUN (ipv6_route_flags,
   int idx_curr;
   char *src, *tag, *distance, *vrf;
 
-  if (!strcmp(argv[3]->text, "from"))
+  if (strmatch(argv[3]->text, "from"))
     {
       src = argv[4]->arg;
       idx_ipv6_ifname = 5;
@@ -2283,7 +2283,7 @@ DEFUN (ipv6_route_ifname,
   int idx_curr = 5;
   char *src, *tag, *distance, *vrf;
 
-  if (!strcmp(argv[3]->text, "from"))
+  if (strmatch(argv[3]->text, "from"))
     {
       src = argv[4]->arg;
       idx_ipv6 = 5;
@@ -2335,7 +2335,7 @@ DEFUN (ipv6_route_ifname_flags,
   int idx_curr;
   char *src, *tag, *distance, *vrf;
 
-  if (!strcmp(argv[3]->text, "from"))
+  if (strmatch(argv[3]->text, "from"))
     {
       src = argv[4]->arg;
       idx_ipv6 = 5;
@@ -2387,7 +2387,7 @@ DEFUN (no_ipv6_route,
   int idx_curr;
   char *src, *tag, *distance, *vrf;
 
-  if (!strcmp(argv[4]->text, "from"))
+  if (strmatch(argv[4]->text, "from"))
     {
       src = argv[5]->arg;
       idx_ipv6_ifname = 6;
@@ -2436,7 +2436,7 @@ DEFUN (no_ipv6_route_flags,
   int idx_curr;
   char *src, *tag, *distance, *vrf;
 
-  if (!strcmp(argv[4]->text, "from"))
+  if (strmatch(argv[4]->text, "from"))
     {
       src = argv[5]->arg;
       idx_ipv6_ifname = 6;
@@ -2486,7 +2486,7 @@ DEFUN (no_ipv6_route_ifname,
   int idx_curr;
   char *src, *tag, *distance, *vrf;
 
-  if (!strcmp(argv[4]->text, "from"))
+  if (strmatch(argv[4]->text, "from"))
     {
       src = argv[5]->arg;
       idx_ipv6 = 6;
@@ -2539,7 +2539,7 @@ DEFUN (no_ipv6_route_ifname_flags,
   int idx_curr;
   char *src, *tag, *distance, *vrf;
 
-  if (!strcmp(argv[4]->text, "from"))
+  if (strmatch(argv[4]->text, "from"))
     {
       src = argv[5]->arg;
       idx_ipv6 = 6;