Commit 3d586a5b authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Increase request seqno by 1 if destination metric is finite.

parent 6a7b3338
...@@ -758,7 +758,7 @@ expire_routes(void) ...@@ -758,7 +758,7 @@ expire_routes(void)
if(route->installed && route->refmetric < INFINITY) { if(route->installed && route->refmetric < INFINITY) {
if(route->time < now.tv_sec - MAX(5, route_timeout_delay - 25)) if(route->time < now.tv_sec - MAX(5, route_timeout_delay - 25))
send_unicast_request(route->nexthop, route->dest, send_unicast_request(route->nexthop, route->dest,
max_request_hopcount, -1); max_request_hopcount, route->dest->seqno);
} }
i++; i++;
} }
......
...@@ -364,7 +364,9 @@ send_request(struct network *net, struct destination *dest, ...@@ -364,7 +364,9 @@ send_request(struct network *net, struct destination *dest,
if(seqno >= 0) if(seqno >= 0)
accumulate_byte(net, seqno); accumulate_byte(net, seqno);
else else
accumulate_byte(net, dest->seqno); accumulate_byte(net,
dest->metric >= INFINITY ?
dest->seqno : ((dest->seqno + 1) & 0xFF));
accumulate_byte(net, hopcount); accumulate_byte(net, hopcount);
} else { } else {
accumulate_byte(net, 0); accumulate_byte(net, 0);
...@@ -399,7 +401,6 @@ send_unicast_packet(struct neighbour *neigh, unsigned char *buf, int buflen) ...@@ -399,7 +401,6 @@ send_unicast_packet(struct neighbour *neigh, unsigned char *buf, int buflen)
} }
} }
void void
send_unicast_request(struct neighbour *neigh, struct destination *dest, send_unicast_request(struct neighbour *neigh, struct destination *dest,
int hopcount, int seqno) int hopcount, int seqno)
...@@ -418,7 +419,9 @@ send_unicast_request(struct neighbour *neigh, struct destination *dest, ...@@ -418,7 +419,9 @@ send_unicast_request(struct neighbour *neigh, struct destination *dest,
if(seqno >= 0) if(seqno >= 0)
buf[1] = seqno; buf[1] = seqno;
else else
buf[1] = dest->seqno; buf[1] =
dest->metric >= INFINITY ?
dest->seqno : ((dest->seqno + 1) & 0xFF);
buf[2] = hopcount; buf[2] = hopcount;
} else { } else {
buf[1] = 0; buf[1] = 0;
......
...@@ -439,7 +439,7 @@ send_triggered_update(struct route *route, int oldmetric) ...@@ -439,7 +439,7 @@ send_triggered_update(struct route *route, int oldmetric)
} else if(route->metric - oldmetric >= 384) { } else if(route->metric - oldmetric >= 384) {
/* This route's metric has increased a lot -- let's hope we find /* This route's metric has increased a lot -- let's hope we find
something better */ something better */
send_request(NULL, route->dest, 1, -1); send_request(NULL, route->dest, 1, route->seqno);
} }
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment