Commit d4e2b1a8 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Don't recompute source in send_unfeasible_request.

parent 2f9c99e8
...@@ -392,7 +392,7 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen, ...@@ -392,7 +392,7 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen,
if(!feasible) if(!feasible)
send_unfeasible_request(neigh, route->installed && route_old(route), send_unfeasible_request(neigh, route->installed && route_old(route),
seqno, metric, a, p, plen); seqno, metric, src);
if(lost) if(lost)
route_lost(oldsrc, oldmetric); route_lost(oldsrc, oldmetric);
...@@ -401,7 +401,7 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen, ...@@ -401,7 +401,7 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen,
/* Somebody's retracting a route we never saw. */ /* Somebody's retracting a route we never saw. */
return NULL; return NULL;
if(!feasible) { if(!feasible) {
send_unfeasible_request(neigh, 0, seqno, metric, a, p, plen); send_unfeasible_request(neigh, 0, seqno, metric, src);
return NULL; return NULL;
} }
if(numroutes >= maxroutes) { if(numroutes >= maxroutes) {
...@@ -437,14 +437,9 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen, ...@@ -437,14 +437,9 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen,
void void
send_unfeasible_request(struct neighbour *neigh, int force, send_unfeasible_request(struct neighbour *neigh, int force,
unsigned short seqno, unsigned short metric, unsigned short seqno, unsigned short metric,
const unsigned char *a, struct source *src)
const unsigned char *prefix, unsigned char plen)
{ {
struct route *route = find_installed_route(prefix, plen); struct route *route = find_installed_route(src->prefix, src->plen);
struct source *src = find_source(a, prefix, plen, 0, 0);
if(src == NULL)
return;
if(seqno_minus(src->seqno, seqno) > 100) { if(seqno_minus(src->seqno, seqno) > 100) {
/* Probably a source that lost its seqno. Let it time-out. */ /* Probably a source that lost its seqno. Let it time-out. */
...@@ -452,7 +447,7 @@ send_unfeasible_request(struct neighbour *neigh, int force, ...@@ -452,7 +447,7 @@ send_unfeasible_request(struct neighbour *neigh, int force,
} }
if(force || !route || route->metric >= metric + 512) { if(force || !route || route->metric >= metric + 512) {
send_unicast_multihop_request(neigh, prefix, plen, send_unicast_multihop_request(neigh, src->prefix, src->plen,
src->metric >= INFINITY ? src->metric >= INFINITY ?
src->seqno : src->seqno :
seqno_plus(src->seqno, 1), seqno_plus(src->seqno, 1),
......
...@@ -66,8 +66,7 @@ struct route *update_route(const unsigned char *a, ...@@ -66,8 +66,7 @@ struct route *update_route(const unsigned char *a,
void retract_neighbour_routes(struct neighbour *neigh); void retract_neighbour_routes(struct neighbour *neigh);
void send_unfeasible_request(struct neighbour *neigh, int force, void send_unfeasible_request(struct neighbour *neigh, int force,
unsigned short seqno, unsigned short metric, unsigned short seqno, unsigned short metric,
const unsigned char *a, struct source *src);
const unsigned char *prefix, unsigned char plen);
void consider_route(struct route *route); void consider_route(struct route *route);
void send_triggered_update(struct route *route, void send_triggered_update(struct route *route,
struct source *oldsrc, unsigned oldmetric); struct source *oldsrc, unsigned oldmetric);
......
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