diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ipcpd/normal/dht.c | 6 | ||||
| -rw-r--r-- | src/lib/CMakeLists.txt | 2 | 
2 files changed, 5 insertions, 3 deletions
diff --git a/src/ipcpd/normal/dht.c b/src/ipcpd/normal/dht.c index 351819c0..e7ba4bf3 100644 --- a/src/ipcpd/normal/dht.c +++ b/src/ipcpd/normal/dht.c @@ -567,12 +567,12 @@ static size_t dht_contact_list(struct dht *       dht,                          c = list_entry(p, struct contact, next);                          c = contact_create(c->id, dht->b, c->addr);                          if (list_add_sorted(l, c, key) == 1) -                                if (++len > dht->k) +                                if (++len == dht->k)                                          break;                  }          } else {                  struct bucket * d = b->parent; -                for (i = 0; i < (1L << KAD_BETA); ++i) { +                for (i = 0; i < (1L << KAD_BETA) && len < dht->k; ++i) {                          list_for_each(p, &d->children[i]->contacts) {                                  struct contact * c;                                  c = list_entry(p, struct contact, next); @@ -580,7 +580,7 @@ static size_t dht_contact_list(struct dht *       dht,                                  if (c == NULL)                                          continue;                                  if (list_add_sorted(l, c, key) == 1) -                                        if (++len > dht->k) +                                        if (++len == dht->k)                                                  break;                          }                  } diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 29ca4db2..6f1cfbb3 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -52,6 +52,8 @@ if (FUSE_LIBRARIES)    else ()      message(STATUS "FUSE support disabled by user")    endif () +else () +  message(STATUS "Install FUSE version > 2.6 to enable RIB access")  endif ()  if (NOT HAVE_FUSE)  | 
