mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-23 01:29:33 +00:00
Rediscover lost routes when forwarding packets. Also refresh route entries when sending packets through them. Patch from Jaroslav Meduna.
This commit is contained in:
parent
17da1fb933
commit
6749281a87
@ -89,10 +89,15 @@ data_packet_forward(struct multihop_conn *multihop,
|
||||
const rimeaddr_t *prevhop, uint8_t hops)
|
||||
{
|
||||
struct route_entry *rt;
|
||||
struct mesh_conn *c = (struct mesh_conn *)
|
||||
((char *)multihop - offsetof(struct mesh_conn, multihop));
|
||||
|
||||
rt = route_lookup(dest);
|
||||
if(rt == NULL) {
|
||||
route_discovery_discover(&c->route_discovery_conn, dest, PACKET_TIMEOUT);
|
||||
return NULL;
|
||||
} else {
|
||||
route_refresh(rt);
|
||||
}
|
||||
|
||||
return &rt->nexthop;
|
||||
|
Loading…
Reference in New Issue
Block a user