diff --git a/overlay_mdp.c b/overlay_mdp.c index 4e2824f2..9c780046 100644 --- a/overlay_mdp.c +++ b/overlay_mdp.c @@ -835,7 +835,7 @@ static int routing_table(struct subscriber *subscriber, void *context){ reply.packetTypeAndFlags=MDP_TX; reply.out.payload_length=sizeof(struct overlay_route_record); memcpy(r->sid, subscriber->sid, SID_SIZE); - r->reachable = subscriber_is_reachable(subscriber); + r->reachable = subscriber->reachable; if (subscriber->reachable==REACHABLE_INDIRECT && subscriber->next_hop) memcpy(r->neighbour, subscriber->next_hop->sid, SID_SIZE); diff --git a/route_link.c b/route_link.c index 33b77120..fb682e9f 100644 --- a/route_link.c +++ b/route_link.c @@ -274,15 +274,16 @@ static void update_path_score(struct neighbour *neighbour, struct link *link){ static int find_best_link(struct subscriber *subscriber) { + IN(); if (subscriber->reachable==REACHABLE_SELF) - return 0; + RETURN(0); struct link_state *state = get_link_state(subscriber); if (state->route_version == route_version) - return 0; + RETURN(0); if (state->calculating) - return -1; + RETURN(-1); state->calculating = 1; struct neighbour *neighbour = neighbours; @@ -341,7 +342,7 @@ next: int reachable = subscriber->reachable; if (next_hop == NULL){ - if (subscriber->reachable&REACHABLE_BROADCAST && !(subscriber->reachable & REACHABLE_ASSUMED)) + if ((subscriber->reachable&REACHABLE_DIRECT) != REACHABLE_UNICAST) reachable = REACHABLE_NONE; } else if (next_hop == subscriber){ // reset the state of any unicast probe's if the interface has changed @@ -377,7 +378,7 @@ next: state->next_update = now; } - return 0; + RETURN(0); } static int monitor_announce(struct subscriber *subscriber, void *context){ diff --git a/tests/routing b/tests/routing index 8460d7ea..d20c3ea6 100755 --- a/tests/routing +++ b/tests/routing @@ -373,6 +373,8 @@ test_lose_neighbours() { stop_servald_server +B foreach_instance +A +C \ wait_until --timeout=30 instance_offline +B + set_instance +A + wait_until --timeout=30 instance_offline +C start_servald_server +B wait_until path_exists +A +B +C wait_until path_exists +C +B +A