summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_neighbor.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d/ospf6_neighbor.c')
-rw-r--r--ospf6d/ospf6_neighbor.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ospf6d/ospf6_neighbor.c b/ospf6d/ospf6_neighbor.c
index 4c24f47131..bb451c239e 100644
--- a/ospf6d/ospf6_neighbor.c
+++ b/ospf6d/ospf6_neighbor.c
@@ -59,7 +59,11 @@ int ospf6_neighbor_cmp(void *va, void *vb)
{
struct ospf6_neighbor *ona = (struct ospf6_neighbor *)va;
struct ospf6_neighbor *onb = (struct ospf6_neighbor *)vb;
- return (ntohl(ona->router_id) < ntohl(onb->router_id) ? -1 : 1);
+
+ if (ona->router_id == onb->router_id)
+ return 0;
+
+ return (ntohl(ona->router_id) < ntohl(onb->router_id)) ? -1 : 1;
}
struct ospf6_neighbor *ospf6_neighbor_lookup(uint32_t router_id,