Permalink
Browse files

Ensure routing table is updated when indirect nodes go offline

  • Loading branch information...
lakeman committed Jun 11, 2013
1 parent 4e3c93e commit c6241c6634088c6e9c60d7681e288821052be687
Showing with 9 additions and 6 deletions.
  1. +1 −1 overlay_mdp.c
  2. +6 −5 route_link.c
  3. +2 −0 tests/routing
@@ -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);
@@ -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 @@ static int find_best_link(struct subscriber *subscriber)
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 @@ static int find_best_link(struct subscriber *subscriber)
state->next_update = now;
}
return 0;
RETURN(0);
}
static int monitor_announce(struct subscriber *subscriber, void *context){
@@ -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

0 comments on commit c6241c6

Please sign in to comment.