Bug fix: only call subscriber if set
This commit is contained in:
parent
1f4ced16eb
commit
0ec8d499e4
1 changed files with 4 additions and 2 deletions
|
@ -28,7 +28,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* 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
|
* \file
|
||||||
|
@ -85,7 +85,9 @@ update_etx(const rimeaddr_t *dest, int packet_etx)
|
||||||
|
|
||||||
if(new_etx > ETX_LIMIT) {
|
if(new_etx > ETX_LIMIT) {
|
||||||
neighbor_attr_remove_neighbor(dest);
|
neighbor_attr_remove_neighbor(dest);
|
||||||
|
if(subscriber_callback != NULL) {
|
||||||
subscriber_callback(dest, 0, new_etx);
|
subscriber_callback(dest, 0, new_etx);
|
||||||
|
}
|
||||||
} else if(neighbor_attr_has_neighbor(dest)) {
|
} else if(neighbor_attr_has_neighbor(dest)) {
|
||||||
neighbor_attr_set_data(&etx, dest, &new_etx);
|
neighbor_attr_set_data(&etx, dest, &new_etx);
|
||||||
if(new_etx != recorded_etx && subscriber_callback != NULL) {
|
if(new_etx != recorded_etx && subscriber_callback != NULL) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue