From 7615a6cf47fe7dd0c78c631331d130743d483369 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Mon, 25 Jan 2010 13:37:05 +0000 Subject: [PATCH] =?UTF-8?q?Bugfix=20by=20Henrik=20M=C3=A4kitaavola:=20chec?= =?UTF-8?q?k=20that=20ICMP6=20process=20is=20defined=20before=20invoking?= =?UTF-8?q?=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/net/tcpip.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/core/net/tcpip.c b/core/net/tcpip.c index 47b913f6f..5bb3a13d0 100644 --- a/core/net/tcpip.c +++ b/core/net/tcpip.c @@ -29,7 +29,7 @@ * This file is part of the Contiki operating system. * * - * $Id: tcpip.c,v 1.21 2009/04/13 19:54:07 nvt-se Exp $ + * $Id: tcpip.c,v 1.22 2010/01/25 13:37:05 adamdunkels Exp $ */ /** * \file @@ -113,8 +113,10 @@ static u8_t (* outputfunc)(uip_lladdr_t *a); u8_t tcpip_output(uip_lladdr_t *a) { + int ret; if(outputfunc != NULL) { - return outputfunc(a); + ret = outputfunc(a); + return ret; } UIP_LOG("tcpip_output: Use tcpip_set_outputfunc() to set an output function"); return 0; @@ -320,8 +322,6 @@ udp_broadcast_new(u16_t port, void *appstate) return conn; } #endif /* UIP_UDP */ - -/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ #if UIP_CONF_ICMP6 u8_t @@ -334,12 +334,15 @@ icmp6_new(void *appstate) { return 1; } -void tcpip_icmp6_call(u8_t type) { - process_post_synch(uip_icmp6_conns.appstate.p, type, 0); +void +tcpip_icmp6_call(u8_t type) +{ + if(uip_icmp6_conns.appstate.p != PROCESS_NONE) { + process_post_synch(uip_icmp6_conns.appstate.p, type, 0); + } return; } - -#endif /*UIP_CONF_ICMP6*/ +#endif /* UIP_CONF_ICMP6 */ /*---------------------------------------------------------------------------*/ static void