]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Minor fixes for debug mode
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Sat, 16 Dec 2017 15:31:43 +0000 (16:31 +0100)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Sat, 16 Dec 2017 15:31:43 +0000 (16:31 +0100)
nest/iface.c
nest/rt-fib.c
proto/bfd/io.c
proto/ospf/ospf.c

index 303a52b2f08b43ccb987003c261c7c87b2c3a5b9..54c16c583d3ef8fbc284b4bad2ee916801d1f6ba 100644 (file)
@@ -93,7 +93,8 @@ if_dump(struct iface *i)
   WALK_LIST(a, i->addrs)
     {
       ifa_dump(a);
-      ASSERT((a != i->addr) == !(a->flags & IA_PRIMARY));
+      ASSERT(!!(a->flags & IA_PRIMARY) ==
+            ((a == i->addr4) || (a == i->addr6) || (a == i->llv6)));
     }
 }
 
index 60c3da555e9cc8f5a54752eeb6ee114c397e0ec5..24a7faccd373634496550691fe32decab9dba42e 100644 (file)
@@ -568,22 +568,17 @@ found:
 void
 fib_check(struct fib *f)
 {
-#if 0
-  uint i, ec, lo, nulls;
+  uint i, ec, nulls;
 
   ec = 0;
   for(i=0; i<f->hash_size; i++)
     {
       struct fib_node *n;
-      lo = 0;
       for(n=f->hash_table[i]; n; n=n->next)
        {
          struct fib_iterator *j, *j0;
-         uint h0 = ipa_hash(n->prefix);
-         if (h0 < lo)
-           bug("fib_check: discord in hash chains");
-         lo = h0;
-         if ((h0 >> f->hash_shift) != i)
+         uint h0 = fib_hash(f, n->addr);
+         if (h0 != i)
            bug("fib_check: mishashed %x->%x (order %d)", h0, i, f->hash_order);
          j0 = (struct fib_iterator *) n;
          nulls = 0;
@@ -604,7 +599,6 @@ fib_check(struct fib *f)
     }
   if (ec != f->entries)
     bug("fib_check: invalid entry count (%d != %d)", ec, f->entries);
-#endif
   return;
 }
 
index b01cbfce5c137db7ceb840ef97a79a42be609cd2..1cd9365adb4df763c6665aae9134cbc19c24bc98 100644 (file)
@@ -298,7 +298,7 @@ sockets_prepare(struct birdloop *loop)
 
   struct pollfd *pfd = loop->poll_fd.data;
   sock **psk = loop->poll_sk.data;
-  int i = 0;
+  uint i = 0;
   node *n;
 
   WALK_LIST(n, loop->sock_list)
index 3ebebdaaa5560c56fcf08c7f4f44fcefe1dc571d..df6c452e7fe55ca1909c503f9842d0fcb62569c7 100644 (file)
@@ -1179,7 +1179,7 @@ ospf_sh_state(struct proto *P, int verbose, int reachable)
   /* We store interesting area-scoped LSAs in array hea and
      global-scoped (LSA_T_EXT) LSAs in array hex */
 
-  int num = p->gr->hash_entries;
+  uint num = p->gr->hash_entries;
   struct top_hash_entry *hea[num];
   struct top_hash_entry *hex[verbose ? num : 0];
   struct top_hash_entry *he;