]> git.puffer.fish Git - mirror/frr.git/commitdiff
[ripd] bug #293: routemap set metric doesn't check for underflow correctly
authorPaul Jakma <paul.jakma@sun.com>
Mon, 11 Sep 2006 02:14:16 +0000 (02:14 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Mon, 11 Sep 2006 02:14:16 +0000 (02:14 +0000)
2006-09-11 Paul Jakma <paul.jakma@sun.com>

* rip_routemap.c: (route_set_metric) underflow check needs to
  use signed, problem identified and diagnosed by Pavel
  Nikiforov in bug #293.

ripd/ChangeLog
ripd/rip_routemap.c

index afae7e9868f6ec02fc4c302b4c481b86241cea2f..68813f14af3ae6d4c770579f3d0da23e1c5b8dfa 100644 (file)
@@ -2,6 +2,9 @@
 
        * ripd.c: (rip_read) remove gratuitous use of mid-function
          declaration of vrecv, bug #278.
+       * rip_routemap.c: (route_set_metric) underflow check needs to
+         use signed, problem identified and diagnosed by Pavel
+         Nikiforov in bug #293.
 
 2006-06-29 Paul Jakma <paul.jakma@sun.com>
 
index 9d6fd16e58e460dbc1ce67ad4c359d9fe0d79ecf..cb87ea555abd4a52bf73dfb183b867a0e780651d 100644 (file)
@@ -530,7 +530,7 @@ route_set_metric (void *rule, struct prefix *prefix,
       else if (mod->type == metric_absolute)
        rinfo->metric_out = mod->metric;
 
-      if (rinfo->metric_out < 1)
+      if ((signed int)rinfo->metric_out < 1)
        rinfo->metric_out = 1;
       if (rinfo->metric_out > RIP_METRIC_INFINITY)
        rinfo->metric_out = RIP_METRIC_INFINITY;