]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
There may be more IP address records with the same IP.
authorOndrej Zajicek <santiago@crfreenet.org>
Sun, 1 May 2011 15:16:05 +0000 (17:16 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Sun, 1 May 2011 16:42:32 +0000 (18:42 +0200)
nest/iface.c

index 3cfc626ab90a6e7e1a2eeabe0a6da27f96cd9e30..2ff2611afe31bd0006d3547ec699783ef6011880 100644 (file)
@@ -451,6 +451,13 @@ ifa_recalc_all_primary_addresses(void)
     }
 }
 
+static inline int
+ifa_same(struct ifa *a, struct ifa *b)
+{
+  return ipa_equal(a->ip, b->ip) && ipa_equal(a->prefix, b->prefix) &&
+    a->pxlen == b->pxlen;
+}
+
 
 /**
  * ifa_update - update interface address
@@ -467,11 +474,9 @@ ifa_update(struct ifa *a)
   struct ifa *b;
 
   WALK_LIST(b, i->addrs)
-    if (ipa_equal(b->ip, a->ip))
+    if (ifa_same(b, a))
       {
-       if (ipa_equal(b->prefix, a->prefix) &&
-           b->pxlen == a->pxlen &&
-           ipa_equal(b->brd, a->brd) &&
+       if (ipa_equal(b->brd, a->brd) &&
            ipa_equal(b->opposite, a->opposite) &&
            b->scope == a->scope &&
            !((b->flags ^ a->flags) & IA_PEER))
@@ -514,7 +519,7 @@ ifa_delete(struct ifa *a)
   struct ifa *b;
 
   WALK_LIST(b, i->addrs)
-    if (ipa_equal(b->ip, a->ip))
+    if (ifa_same(b, a))
       {
        rem_node(&b->n);
        if (b->flags & IF_UP)