Commit 1a1c8054 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Add neighbour parameter to send_request_resend.

parent f4f3c9d5
...@@ -513,11 +513,17 @@ send_request(struct network *net, ...@@ -513,11 +513,17 @@ send_request(struct network *net,
} }
void void
send_request_resend(const unsigned char *prefix, unsigned char plen, send_request_resend(struct neighbour *neigh,
const unsigned char *prefix, unsigned char plen,
unsigned short seqno, unsigned short router_hash) unsigned short seqno, unsigned short router_hash)
{ {
if(neigh)
send_unicast_request(neigh, prefix, plen, 127, seqno, router_hash);
else
send_request(NULL, prefix, plen, 127, seqno, router_hash); send_request(NULL, prefix, plen, 127, seqno, router_hash);
record_request(prefix, plen, seqno, router_hash, NULL,
record_request(prefix, plen, seqno, router_hash,
neigh ? neigh->network : NULL,
MAX(10, MAX(10,
MIN(wireless_hello_interval / 2, MIN(wireless_hello_interval / 2,
MIN(wired_hello_interval / 2, MIN(wired_hello_interval / 2,
......
...@@ -47,7 +47,8 @@ void send_request(struct network *net, ...@@ -47,7 +47,8 @@ void send_request(struct network *net,
const unsigned char *prefix, unsigned char plen, const unsigned char *prefix, unsigned char plen,
unsigned char hop_count, unsigned short seqno, unsigned char hop_count, unsigned short seqno,
unsigned short router_hash); unsigned short router_hash);
void send_request_resend(const unsigned char *prefix, unsigned char plen, void send_request_resend(struct neighbour *neigh,
const unsigned char *prefix, unsigned char plen,
unsigned short seqno, unsigned short router_hash); unsigned short seqno, unsigned short router_hash);
void send_unicast_request(struct neighbour *neigh, void send_unicast_request(struct neighbour *neigh,
const unsigned char *prefix, unsigned char plen, const unsigned char *prefix, unsigned char plen,
......
...@@ -475,7 +475,7 @@ send_unfeasible_request(unsigned short seqno, unsigned short metric, ...@@ -475,7 +475,7 @@ send_unfeasible_request(unsigned short seqno, unsigned short metric,
} }
if(!route || route->metric >= metric + 256) { if(!route || route->metric >= metric + 256) {
send_request_resend(prefix, plen, send_request_resend(NULL, prefix, plen,
src->metric >= INFINITY ? src->metric >= INFINITY ?
src->seqno : seqno_plus(src->seqno, 1), src->seqno : seqno_plus(src->seqno, 1),
hash_id(src->address)); hash_id(src->address));
...@@ -562,7 +562,7 @@ send_triggered_update(struct route *route, struct source *oldsrc, int oldmetric) ...@@ -562,7 +562,7 @@ send_triggered_update(struct route *route, struct source *oldsrc, int oldmetric)
if(oldmetric < INFINITY) { if(oldmetric < INFINITY) {
if(newmetric >= INFINITY || newmetric >= oldmetric + 384) if(newmetric >= INFINITY || newmetric >= oldmetric + 384)
send_request_resend(route->src->prefix, route->src->plen, send_request_resend(NULL, route->src->prefix, route->src->plen,
route->src->metric >= INFINITY ? route->src->metric >= INFINITY ?
route->src->seqno : route->src->seqno :
seqno_plus(route->src->seqno, 1), seqno_plus(route->src->seqno, 1),
...@@ -609,7 +609,7 @@ route_lost(struct source *src, int oldmetric) ...@@ -609,7 +609,7 @@ route_lost(struct source *src, int oldmetric)
/* Complain loudly. */ /* Complain loudly. */
send_update(NULL, 1, src->prefix, src->plen); send_update(NULL, 1, src->prefix, src->plen);
if(oldmetric < INFINITY) if(oldmetric < INFINITY)
send_request_resend(src->prefix, src->plen, send_request_resend(NULL, src->prefix, src->plen,
src->metric >= INFINITY ? src->metric >= INFINITY ?
src->seqno : seqno_plus(src->seqno, 1), src->seqno : seqno_plus(src->seqno, 1),
hash_id(src->address)); hash_id(src->address));
......
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