From 513393db54f0e393569d7fead52727bfa9513065 Mon Sep 17 00:00:00 2001 From: Joakim Eriksson Date: Thu, 20 Aug 2015 16:56:50 +0200 Subject: [PATCH] added return value so that caller know if a nbr was removed or not --- core/net/ipv6/uip-ds6-nbr.c | 6 +++--- core/net/ipv6/uip-ds6-nbr.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/net/ipv6/uip-ds6-nbr.c b/core/net/ipv6/uip-ds6-nbr.c index b793ab9f0..5905993a5 100644 --- a/core/net/ipv6/uip-ds6-nbr.c +++ b/core/net/ipv6/uip-ds6-nbr.c @@ -115,7 +115,7 @@ uip_ds6_nbr_add(const uip_ipaddr_t *ipaddr, const uip_lladdr_t *lladdr, } /*---------------------------------------------------------------------------*/ -void +int uip_ds6_nbr_rm(uip_ds6_nbr_t *nbr) { if(nbr != NULL) { @@ -123,9 +123,9 @@ uip_ds6_nbr_rm(uip_ds6_nbr_t *nbr) uip_packetqueue_free(&nbr->packethandle); #endif /* UIP_CONF_IPV6_QUEUE_PKT */ NEIGHBOR_STATE_CHANGED(nbr); - nbr_table_remove(ds6_neighbors, nbr); + return nbr_table_remove(ds6_neighbors, nbr); } - return; + return 0; } /*---------------------------------------------------------------------------*/ diff --git a/core/net/ipv6/uip-ds6-nbr.h b/core/net/ipv6/uip-ds6-nbr.h index 24e3f7aaf..b0dd84d4a 100644 --- a/core/net/ipv6/uip-ds6-nbr.h +++ b/core/net/ipv6/uip-ds6-nbr.h @@ -88,7 +88,7 @@ void uip_ds6_neighbors_init(void); /** \brief Neighbor Cache basic routines */ uip_ds6_nbr_t *uip_ds6_nbr_add(const uip_ipaddr_t *ipaddr, const uip_lladdr_t *lladdr, uint8_t isrouter, uint8_t state); -void uip_ds6_nbr_rm(uip_ds6_nbr_t *nbr); +int uip_ds6_nbr_rm(uip_ds6_nbr_t *nbr); const uip_lladdr_t *uip_ds6_nbr_get_ll(const uip_ds6_nbr_t *nbr); const uip_ipaddr_t *uip_ds6_nbr_get_ipaddr(const uip_ds6_nbr_t *nbr); uip_ds6_nbr_t *uip_ds6_nbr_lookup(const uip_ipaddr_t *ipaddr);