From: Daniel Walton <[email protected]>

Signed-off-by: Daniel Walton <[email protected]>
---
 bgpd/bgp_routemap.c     | 20 ++++++++++----------
 ospf6d/ospf6_asbr.c     |  6 +++---
 ospfd/ospf_routemap.c   | 31 +++++++++++++++++++++++--------
 ripd/rip_routemap.c     | 16 ++++++++--------
 ripngd/ripng_routemap.c | 16 ++++++++--------
 zebra/zebra_routemap.c  | 16 ++++++++--------
 6 files changed, 60 insertions(+), 45 deletions(-)

diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index c7b7f29..2738944 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -2456,10 +2456,10 @@ bgp_route_match_add (struct vty *vty, struct 
route_map_index *index,
       switch (ret)
        {
        case RMAP_RULE_MISSING:
-         vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
+         vty_out (vty, "%% BGP Can't find rule.%s", VTY_NEWLINE);
          return CMD_WARNING;
        case RMAP_COMPILE_ERROR:
-         vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
+         vty_out (vty, "%% BGP Argument is malformed.%s", VTY_NEWLINE);
          return CMD_WARNING;
        }
     }
@@ -2500,10 +2500,10 @@ bgp_route_match_delete (struct vty *vty, struct 
route_map_index *index,
       switch (ret)
        {
        case RMAP_RULE_MISSING:
-         vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
+         vty_out (vty, "%% BGP Can't find rule.%s", VTY_NEWLINE);
          break;
        case RMAP_COMPILE_ERROR:
-         vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
+         vty_out (vty, "%% BGP Argument is malformed.%s", VTY_NEWLINE);
          break;
        }
       if (arg == NULL && dep_name)
@@ -2537,10 +2537,10 @@ bgp_route_set_add (struct vty *vty, struct 
route_map_index *index,
       switch (ret)
        {
        case RMAP_RULE_MISSING:
-         vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
+         vty_out (vty, "%% BGP Can't find rule.%s", VTY_NEWLINE);
          return CMD_WARNING;
        case RMAP_COMPILE_ERROR:
-         vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
+         vty_out (vty, "%% BGP Argument is malformed.%s", VTY_NEWLINE);
          return CMD_WARNING;
        }
     }
@@ -2560,10 +2560,10 @@ bgp_route_set_delete (struct vty *vty, struct 
route_map_index *index,
       switch (ret)
        {
        case RMAP_RULE_MISSING:
-         vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
+         vty_out (vty, "%% BGP Can't find rule.%s", VTY_NEWLINE);
          return CMD_WARNING;
        case RMAP_COMPILE_ERROR:
-         vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
+         vty_out (vty, "%% BGP Argument is malformed.%s", VTY_NEWLINE);
          return CMD_WARNING;
        }
     }
@@ -3980,7 +3980,7 @@ DEFUN (set_community_delete,
        SET_STR
        "set BGP community list (for deletion)\n"
        "Community-list number (standard)\n"
-       "Communitly-list number (expanded)\n"
+       "Community-list number (expanded)\n"
        "Community-list name\n"
        "Delete matching communities\n")
 {
@@ -4013,7 +4013,7 @@ ALIAS (no_set_community_delete,
        SET_STR
        "set BGP community list (for deletion)\n"
        "Community-list number (standard)\n"
-       "Communitly-list number (expanded)\n"
+       "Community-list number (expanded)\n"
        "Community-list name\n"
        "Delete matching communities\n")
 
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index f99ccab..f675423 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -977,13 +977,13 @@ route_map_command_status (struct vty *vty, int ret)
   switch (ret)
     {
     case RMAP_RULE_MISSING:
-      vty_out (vty, "Can't find rule.%s", VNL);
+      vty_out (vty, "OSPF6 Can't find rule.%s", VNL);
       break;
     case RMAP_COMPILE_ERROR:
-      vty_out (vty, "Argument is malformed.%s", VNL);
+      vty_out (vty, "OSPF6 Argument is malformed.%s", VNL);
       break;
     default:
-      vty_out (vty, "route-map add set failed.%s", VNL);
+      vty_out (vty, "OSPF6 route-map add set failed.%s", VNL);
       break;
     }
   return CMD_WARNING;
diff --git a/ospfd/ospf_routemap.c b/ospfd/ospf_routemap.c
index 7bd6c3d..133b1e3 100644
--- a/ospfd/ospf_routemap.c
+++ b/ospfd/ospf_routemap.c
@@ -108,10 +108,10 @@ ospf_route_match_delete (struct vty *vty, struct 
route_map_index *index,
       switch (ret)
         {
         case RMAP_RULE_MISSING:
-          vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
+          vty_out (vty, "%% OSPF Can't find rule.%s", VTY_NEWLINE);
           return CMD_WARNING;
         case RMAP_COMPILE_ERROR:
-          vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
+          vty_out (vty, "%% OSPF Argument is malformed.%s", VTY_NEWLINE);
           return CMD_WARNING;
         }
     }
@@ -131,10 +131,10 @@ ospf_route_match_add (struct vty *vty, struct 
route_map_index *index,
       switch (ret)
         {
         case RMAP_RULE_MISSING:
-          vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
+          vty_out (vty, "%% OSPF Can't find rule.%s", VTY_NEWLINE);
           return CMD_WARNING;
         case RMAP_COMPILE_ERROR:
-          vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
+          vty_out (vty, "%% OSPF Argument is malformed.%s", VTY_NEWLINE);
           return CMD_WARNING;
         }
     }
@@ -154,10 +154,10 @@ ospf_route_set_add (struct vty *vty, struct 
route_map_index *index,
       switch (ret)
         {
         case RMAP_RULE_MISSING:
-          vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
+          vty_out (vty, "%% OSPF Can't find rule.%s", VTY_NEWLINE);
           return CMD_WARNING;
         case RMAP_COMPILE_ERROR:
-          vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
+          vty_out (vty, "%% OSPF Argument is malformed.%s", VTY_NEWLINE);
           return CMD_WARNING;
         }
     }
@@ -178,10 +178,10 @@ ospf_route_set_delete (struct vty *vty, struct 
route_map_index *index,
       switch (ret)
         {
         case RMAP_RULE_MISSING:
-          vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
+          vty_out (vty, "%% OSPF Can't find rule.%s", VTY_NEWLINE);
           return CMD_WARNING;
         case RMAP_COMPILE_ERROR:
-          vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
+          vty_out (vty, "%% OSPF Argument is malformed.%s", VTY_NEWLINE);
           return CMD_WARNING;
         }
     }
@@ -506,6 +506,21 @@ route_set_metric_compile (const char *arg)
   u_int32_t *metric;
   int32_t ret;
 
+  /* OSPF doesn't support the +/- in
+     set metric <+/-metric> check
+     Ignore the +/- component */
+  if (! all_digit (arg))
+    {
+      if ((strncmp (arg, "+", 1) == 0 || strncmp (arg, "-", 1) == 0) &&
+         all_digit (arg+1))
+       {
+         zlog_warn ("OSPF does not support 'set metric +/-'");
+         arg++;
+       }
+      else
+       return NULL;
+    }
+
   metric = XCALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (u_int32_t));
   ret = atoi (arg);
 
diff --git a/ripd/rip_routemap.c b/ripd/rip_routemap.c
index cc0ed61..e04e43d 100644
--- a/ripd/rip_routemap.c
+++ b/ripd/rip_routemap.c
@@ -58,10 +58,10 @@ rip_route_match_add (struct vty *vty, struct 
route_map_index *index,
       switch (ret)
        {
        case RMAP_RULE_MISSING:
-         vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
+         vty_out (vty, "%% RIP Can't find rule.%s", VTY_NEWLINE);
          return CMD_WARNING;
        case RMAP_COMPILE_ERROR:
-         vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
+         vty_out (vty, "%% RIP Argument is malformed.%s", VTY_NEWLINE);
          return CMD_WARNING;
        }
     }
@@ -81,10 +81,10 @@ rip_route_match_delete (struct vty *vty, struct 
route_map_index *index,
       switch (ret)
        {
        case RMAP_RULE_MISSING:
-         vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
+         vty_out (vty, "%% RIP Can't find rule.%s", VTY_NEWLINE);
          return CMD_WARNING;
        case RMAP_COMPILE_ERROR:
-         vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
+         vty_out (vty, "%% RIP Argument is malformed.%s", VTY_NEWLINE);
          return CMD_WARNING;
        }
     }
@@ -104,7 +104,7 @@ rip_route_set_add (struct vty *vty, struct route_map_index 
*index,
       switch (ret)
        {
        case RMAP_RULE_MISSING:
-         vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
+         vty_out (vty, "%% RIP Can't find rule.%s", VTY_NEWLINE);
          return CMD_WARNING;
        case RMAP_COMPILE_ERROR:
          /* rip, ripng and other protocols share the set metric command
@@ -112,7 +112,7 @@ rip_route_set_add (struct vty *vty, struct route_map_index 
*index,
             if metric is out of range for rip and ripng, it is not for
             other protocols. Do not return an error */
          if (strcmp(command, "metric")) {
-            vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
+            vty_out (vty, "%% RIP Argument is malformed.%s", VTY_NEWLINE);
             return CMD_WARNING;
          }
        }
@@ -133,10 +133,10 @@ rip_route_set_delete (struct vty *vty, struct 
route_map_index *index,
       switch (ret)
        {
        case RMAP_RULE_MISSING:
-         vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
+         vty_out (vty, "%% RIP Can't find rule.%s", VTY_NEWLINE);
          return CMD_WARNING;
        case RMAP_COMPILE_ERROR:
-         vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
+         vty_out (vty, "%% RIP Argument is malformed.%s", VTY_NEWLINE);
          return CMD_WARNING;
        }
     }
diff --git a/ripngd/ripng_routemap.c b/ripngd/ripng_routemap.c
index a316301..eae4566 100644
--- a/ripngd/ripng_routemap.c
+++ b/ripngd/ripng_routemap.c
@@ -55,10 +55,10 @@ ripng_route_match_add (struct vty *vty, struct 
route_map_index *index,
       switch (ret)
        {
        case RMAP_RULE_MISSING:
-         vty_out (vty, "Can't find rule.%s", VTY_NEWLINE);
+         vty_out (vty, "RIPng Can't find rule.%s", VTY_NEWLINE);
          return CMD_WARNING;
        case RMAP_COMPILE_ERROR:
-         vty_out (vty, "Argument is malformed.%s", VTY_NEWLINE);
+         vty_out (vty, "RIPng Argument is malformed.%s", VTY_NEWLINE);
          return CMD_WARNING;
        }
     }
@@ -77,10 +77,10 @@ ripng_route_match_delete (struct vty *vty, struct 
route_map_index *index,
       switch (ret)
        {
        case RMAP_RULE_MISSING:
-         vty_out (vty, "Can't find rule.%s", VTY_NEWLINE);
+         vty_out (vty, "RIPng Can't find rule.%s", VTY_NEWLINE);
          return CMD_WARNING;
        case RMAP_COMPILE_ERROR:
-         vty_out (vty, "Argument is malformed.%s", VTY_NEWLINE);
+         vty_out (vty, "RIPng Argument is malformed.%s", VTY_NEWLINE);
          return CMD_WARNING;
        }
     }
@@ -99,10 +99,10 @@ ripng_route_set_add (struct vty *vty, struct 
route_map_index *index,
       switch (ret)
        {
        case RMAP_RULE_MISSING:
-         vty_out (vty, "Can't find rule.%s", VTY_NEWLINE);
+         vty_out (vty, "RIPng Can't find rule.%s", VTY_NEWLINE);
          return CMD_WARNING;
        case RMAP_COMPILE_ERROR:
-         vty_out (vty, "Argument is malformed.%s", VTY_NEWLINE);
+         vty_out (vty, "RIPng Argument is malformed.%s", VTY_NEWLINE);
          return CMD_WARNING;
        }
     }
@@ -121,10 +121,10 @@ ripng_route_set_delete (struct vty *vty, struct 
route_map_index *index,
       switch (ret)
        {
        case RMAP_RULE_MISSING:
-         vty_out (vty, "Can't find rule.%s", VTY_NEWLINE);
+         vty_out (vty, "RIPng Can't find rule.%s", VTY_NEWLINE);
          return CMD_WARNING;
        case RMAP_COMPILE_ERROR:
-         vty_out (vty, "Argument is malformed.%s", VTY_NEWLINE);
+         vty_out (vty, "RIPng Argument is malformed.%s", VTY_NEWLINE);
          return CMD_WARNING;
        }
     }
diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c
index e0b6e3e..447863c 100644
--- a/zebra/zebra_routemap.c
+++ b/zebra/zebra_routemap.c
@@ -66,10 +66,10 @@ zebra_route_match_add(struct vty *vty, struct 
route_map_index *index,
       switch (ret)
        {
        case RMAP_RULE_MISSING:
-         vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
+         vty_out (vty, "%% Zebra Can't find rule.%s", VTY_NEWLINE);
          return CMD_WARNING;
        case RMAP_COMPILE_ERROR:
-         vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
+         vty_out (vty, "%% Zebra Argument is malformed.%s", VTY_NEWLINE);
          return CMD_WARNING;
        }
     }
@@ -109,10 +109,10 @@ zebra_route_match_delete (struct vty *vty, struct 
route_map_index *index,
       switch (ret)
        {
        case RMAP_RULE_MISSING:
-         vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
+         vty_out (vty, "%% Zebra Can't find rule.%s", VTY_NEWLINE);
          return CMD_WARNING;
        case RMAP_COMPILE_ERROR:
-         vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
+         vty_out (vty, "%% Zebra Argument is malformed.%s", VTY_NEWLINE);
          return CMD_WARNING;
        }
     }
@@ -141,10 +141,10 @@ zebra_route_set_add (struct vty *vty, struct 
route_map_index *index,
       switch (ret)
        {
        case RMAP_RULE_MISSING:
-         vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
+         vty_out (vty, "%% Zebra Can't find rule.%s", VTY_NEWLINE);
          return CMD_WARNING;
        case RMAP_COMPILE_ERROR:
-         vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
+         vty_out (vty, "%% Zebra Argument is malformed.%s", VTY_NEWLINE);
          return CMD_WARNING;
        }
     }
@@ -164,10 +164,10 @@ zebra_route_set_delete (struct vty *vty, struct 
route_map_index *index,
       switch (ret)
        {
        case RMAP_RULE_MISSING:
-         vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
+         vty_out (vty, "%% Zebra Can't find rule.%s", VTY_NEWLINE);
          return CMD_WARNING;
        case RMAP_COMPILE_ERROR:
-         vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
+         vty_out (vty, "%% Zebra Argument is malformed.%s", VTY_NEWLINE);
          return CMD_WARNING;
        }
     }
-- 
1.9.1


_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to