]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes a bug in NBMA on an iface with multiple IP addresses.
authorOndrej Zajicek <santiago@crfreenet.org>
Sun, 22 Aug 2010 12:43:53 +0000 (14:43 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Sun, 22 Aug 2010 12:43:53 +0000 (14:43 +0200)
proto/ospf/iface.c
proto/ospf/ospf.c

index bef311251406e771e09d2739a821930ac141c36c..04868baaf47f46e719b68b2c9797df60f815c3b8 100644 (file)
@@ -472,6 +472,9 @@ ospf_iface_new(struct proto_ospf *po, struct iface *iface, struct ifa *addr,
 
   WALK_LIST(nb, ip->nbma_list)
   {
+    if (!ipa_in_net(nb->ip, addr->prefix, addr->pxlen))
+      continue;
+
     nbma = mb_alloc(p->pool, sizeof(struct nbma_node));
     nbma->ip = nb->ip;
     nbma->eligible = nb->eligible;
index e1ba96a4f35cf2b0bce4eaec6cd97b62b3429180..a9dc1deed6ce89586d4386ddeabb575465f96f36 100644 (file)
@@ -855,7 +855,7 @@ ospf_reconfigure(struct proto *p, struct proto_config *c)
        {
          found = 0;
          WALK_LIST(nb2, newip->nbma_list)
-           if (ipa_compare(nb1->ip, nb2->ip) == 0)
+           if (ipa_equal(nb1->ip, nb2->ip))
          {
            found = 1;
            if (nb1->eligible != nb2->eligible)
@@ -877,9 +877,12 @@ ospf_reconfigure(struct proto *p, struct proto_config *c)
        /* And then add new */
        WALK_LIST(nb2, newip->nbma_list)
        {
+         if (!ipa_in_net(nb2->ip, ifa->addr->prefix, ifa->addr->pxlen))
+           continue;
+
          found = 0;
          WALK_LIST(nb1, ifa->nbma_list)
-           if (ipa_compare(nb1->ip, nb2->ip) == 0)
+           if (ipa_equal(nb1->ip, nb2->ip))
          {
            found = 1;
            break;