From e2bbdbca9b0001b6ddb0fa998aceca3490e40cb3 Mon Sep 17 00:00:00 2001 From: nvt-se Date: Tue, 19 May 2009 11:54:50 +0000 Subject: [PATCH] decrement TTL right after forwarding check. --- core/net/uip6.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/net/uip6.c b/core/net/uip6.c index ddd9e2923..f63cfe430 100644 --- a/core/net/uip6.c +++ b/core/net/uip6.c @@ -41,7 +41,7 @@ * * This file is part of the uIP TCP/IP stack. * - * $Id: uip6.c,v 1.5 2009/04/06 13:18:51 nvt-se Exp $ + * $Id: uip6.c,v 1.6 2009/05/19 11:54:50 nvt-se Exp $ * */ @@ -1092,6 +1092,9 @@ uip_process(u8_t flag) PRINTF("Forwarding packet to "); PRINT6ADDR(&UIP_IP_BUF->destipaddr); PRINTF("\n"); + + /* Decrement the TTL (time-to-live) value in the IP header */ + UIP_IP_BUF->ttl = UIP_IP_BUF->ttl - 1; UIP_STAT(++uip_stat.ip.forwarded); goto send; } else if(!uip_is_addr_linklocal_allnodes_mcast(&UIP_IP_BUF->destipaddr)) {