Refresh routes when a packet is received. Set a conservatively low route timeout (10 seconds).

This commit is contained in:
adamdunkels 2009-05-04 11:24:04 +00:00
parent c83c5c4c55
commit 1752b53f74

View File

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: uip-over-mesh.c,v 1.12 2009/04/29 11:40:33 adamdunkels Exp $
* $Id: uip-over-mesh.c,v 1.13 2009/05/04 11:24:04 adamdunkels Exp $
*/
/**
@ -80,6 +80,11 @@ static uip_ipaddr_t netaddr, netmask;
static void
recv_data(struct unicast_conn *c, rimeaddr_t *from)
{
struct route_entry *e;
e = route_lookup(from);
route_refresh(e);
uip_len = packetbuf_copyto(&uip_buf[UIP_LLH_LEN]);
/* uip_len = hc_inflate(&uip_buf[UIP_LLH_LEN], uip_len);*/
@ -185,8 +190,8 @@ uip_over_mesh_init(u16_t channels)
trickle_open(&gateway_announce_conn, CLOCK_SECOND * 4, channels + 3,
&trickle_call);
/* tcpip_set_forwarding(1);*/
/* Set lifetime to 10 seconds for non-refreshed routes. */
route_set_lifetime(10);
}
/*---------------------------------------------------------------------------*/
u8_t