From 10fb99a89d8f69a07881e0c222381eb7e1d6ee7f Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Thu, 16 Dec 2010 22:46:34 +0000 Subject: [PATCH] Reduced the value of the max depth, so that a count-to-infinity loop will not count too long before hitting the maximum value. This is important when a network loses its sink, so that packets are not forwarded around the network for ever. --- core/net/rime/collect.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/net/rime/collect.h b/core/net/rime/collect.h index fe790b525..142a1e001 100644 --- a/core/net/rime/collect.h +++ b/core/net/rime/collect.h @@ -47,7 +47,7 @@ * * This file is part of the Contiki operating system. * - * $Id: collect.h,v 1.24 2010/11/06 14:32:10 adamdunkels Exp $ + * $Id: collect.h,v 1.25 2010/12/16 22:46:34 adamdunkels Exp $ */ /** @@ -109,6 +109,8 @@ struct collect_conn { uint8_t sending, transmissions, max_rexmits; uint8_t eseqno; uint8_t is_router; + + clock_time_t send_time; }; enum { @@ -132,7 +134,7 @@ void collect_set_keepalive(struct collect_conn *c, clock_time_t period); void collect_print_stats(void); -#define COLLECT_MAX_DEPTH ((1 << 12) - 1) +#define COLLECT_MAX_DEPTH (COLLECT_LINK_ESTIMATE_UNIT * 32 - 1) #endif /* __COLLECT_H__ */ /** @} */