]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Quagga: Fix memcmp usage for MPLS
authorvivek <vivek@cumulusnetworks.com>
Mon, 18 Apr 2016 18:02:26 +0000 (18:02 +0000)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 23 Sep 2016 13:30:58 +0000 (09:30 -0400)
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-6611
Reviewed By: Trivial
Testing Done: Manual in SE-1

zebra/zebra_mpls.c

index 688585d6daf8d68308a4bc8a861a5ea5e9b4c9ec..096f576a4cc68a6d4a798483b12bc9e74e38139e 100644 (file)
@@ -604,20 +604,20 @@ nhlfe_nhop_match (zebra_nhlfe_t *nhlfe, enum nexthop_types_t gtype,
                   union g_addr *gate, char *ifname, ifindex_t ifindex)
 {
   struct nexthop *nhop;
-  u_char cmp = -1;
+  int cmp = 1;
 
   nhop = nhlfe->nexthop;
   if (!nhop)
-    return -1;
+    return 1;
 
   if (nhop->type != gtype)
-    return -1;
+    return 1;
 
   switch (nhop->type)
     {
     case NEXTHOP_TYPE_IPV4:
       cmp = memcmp(&(nhop->gate.ipv4), &(gate->ipv4),
-                  sizeof(struct in_addr));
+                   sizeof(struct in_addr));
       break;
     case NEXTHOP_TYPE_IPV6:
     case NEXTHOP_TYPE_IPV6_IFINDEX:
@@ -1086,10 +1086,10 @@ static int
 snhlfe_match (zebra_snhlfe_t *snhlfe, enum nexthop_types_t gtype,
               union g_addr *gate, char *ifname, ifindex_t ifindex)
 {
-  u_char cmp = -1;
+  int cmp = 1;
 
   if (snhlfe->gtype != gtype)
-    return -1;
+    return 1;
 
   switch (snhlfe->gtype)
     {