From 0ec8d499e490602f5d62cd614c3cca4795391e43 Mon Sep 17 00:00:00 2001 From: nifi Date: Thu, 25 Mar 2010 19:30:44 +0000 Subject: [PATCH] Bug fix: only call subscriber if set --- core/net/neighbor-info.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/net/neighbor-info.c b/core/net/neighbor-info.c index 1bf37acae..66f9d8647 100644 --- a/core/net/neighbor-info.c +++ b/core/net/neighbor-info.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: neighbor-info.c,v 1.4 2010/03/19 16:55:29 nvt-se Exp $ + * $Id: neighbor-info.c,v 1.5 2010/03/25 19:30:44 nifi Exp $ */ /** * \file @@ -85,7 +85,9 @@ update_etx(const rimeaddr_t *dest, int packet_etx) if(new_etx > ETX_LIMIT) { neighbor_attr_remove_neighbor(dest); - subscriber_callback(dest, 0, new_etx); + if(subscriber_callback != NULL) { + subscriber_callback(dest, 0, new_etx); + } } else if(neighbor_attr_has_neighbor(dest)) { neighbor_attr_set_data(&etx, dest, &new_etx); if(new_etx != recorded_etx && subscriber_callback != NULL) {