Test reachable bit flags about ourself

This commit is contained in:
Jeremy Lakeman 2016-09-20 15:04:28 +09:30
parent 275c99bc4e
commit 4e50b1716c
3 changed files with 4 additions and 4 deletions

View File

@ -1752,7 +1752,7 @@ int keyring_send_unlock(struct subscriber *subscriber)
{
if (!subscriber->identity)
return WHY("Cannot unlock an identity we don't have in our keyring");
if (subscriber->reachable==REACHABLE_SELF)
if (subscriber->reachable & REACHABLE_SELF)
return 0;
struct internal_mdp_header header;

View File

@ -1014,7 +1014,7 @@ static int search_subscribers(void **record, void *context){
struct subscriber *subscriber=*record;
struct overlay_mdp_addrlist *response = context;
if (response->mode == MDP_ADDRLIST_MODE_SELF && subscriber->reachable != REACHABLE_SELF){
if (response->mode == MDP_ADDRLIST_MODE_SELF && (subscriber->reachable & REACHABLE_SELF)==0){
return 0;
}
@ -1024,7 +1024,7 @@ static int search_subscribers(void **record, void *context){
}
if (response->mode == MDP_ADDRLIST_MODE_ALL_PEERS &&
subscriber->reachable == REACHABLE_SELF){
(subscriber->reachable & REACHABLE_SELF)){
return 0;
}

View File

@ -376,7 +376,7 @@ static void update_path_score(struct neighbour *neighbour, struct link *link){
static struct link * find_best_link(struct subscriber *subscriber)
{
IN();
if (subscriber->reachable==REACHABLE_SELF)
if (subscriber->reachable & REACHABLE_SELF)
RETURN(NULL);
struct link_state *state = get_link_state(subscriber);