File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -525,9 +525,18 @@ bool zebra_nhg_hash_equal(const void *arg1, const void *arg2)
525525 struct nexthop * nexthop1 ;
526526 struct nexthop * nexthop2 ;
527527
528- /* No matter what if they equal IDs, assume equal */
529- if (nhe1 -> id && nhe2 -> id && (nhe1 -> id == nhe2 -> id ))
530- return true;
528+ /* If both NHG's have id's then we can just know that
529+ * they are either identical or not. This comparison
530+ * is only ever used for hash equality. NHE's id
531+ * is sufficient to distinguish them. This is especially
532+ * true if NHG's are owned by an upper level protocol.
533+ */
534+ if (nhe1 -> id && nhe2 -> id ) {
535+ if (nhe1 -> id == nhe2 -> id )
536+ return true;
537+
538+ return false;
539+ }
531540
532541 if (nhe1 -> type != nhe2 -> type )
533542 return false;
You can’t perform that action at this time.
0 commit comments