X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=vnet%2Fvnet%2Flisp-cp%2Flisp_types.c;h=c65745dd0860645d5d15bafa2aae72b9ffbf449b;hb=254b036dff8ac1ffc663788766de999a2837dc7e;hp=a04d36ff8d05b9400e473d1a8c020edda8ad0aab;hpb=42f2006975c5a0ea58c835df4461213072f8813f;p=vpp.git diff --git a/vnet/vnet/lisp-cp/lisp_types.c b/vnet/vnet/lisp-cp/lisp_types.c index a04d36ff8d0..c65745dd086 100644 --- a/vnet/vnet/lisp-cp/lisp_types.c +++ b/vnet/vnet/lisp-cp/lisp_types.c @@ -313,7 +313,17 @@ ip_prefix_cmp(ip_prefix_t * p1, ip_prefix_t * p2) int cmp = 0; cmp = ip_address_cmp (&ip_prefix_addr(p1), &ip_prefix_addr(p2)); if (cmp == 0) - cmp = ip_prefix_len(p1) < ip_prefix_len(p2) ? 1 : 2; /* XXX ? */ + { + if (ip_prefix_len(p1) < ip_prefix_len(p2)) + { + cmp = 1; + } + else + { + if (ip_prefix_len(p1) > ip_prefix_len(p2)) + cmp = 2; + } + } return cmp; }