Commit 84b47833 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Forward multihop requests.

For now, we don't keep track of forwarded requests, so we might still
reply with the old seqno.
parent da59d46e
......@@ -117,9 +117,30 @@ parse_packet(const unsigned char *from, struct network *net,
} else {
struct destination *dest;
dest = find_destination(message + 4, 0, 0);
if(dest)
if(dest) {
if(message[2] == 0) {
send_update(dest, neigh->network);
} else {
/* Request for a new seqno */
int hopcount = message[2];
int seqno = message[1];
struct route *installed;
installed = find_installed_route(dest);
if(installed) {
if(seqno_compare(installed->seqno, seqno) >= 0)
send_update(dest, neigh->network);
else if(hopcount >= 2) {
send_unicast_request(installed->nexthop,
dest,
hopcount - 1);
/* For now, let's hope the new seqno
arrives before the update is flushed. */
send_update(dest, neigh->network);
}
}
}
}
}
} else if(message[0] == 2) {
debugf("Received update on %s from %s (%s) for %s.\n",
net->ifname,
......
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