gnrc: nib: DEBUG fix

This commit is contained in:
Kaspar Schleiser 2017-10-20 23:54:40 +02:00
parent fd884c2d05
commit 12d4254ae1
6 changed files with 11 additions and 21 deletions

View File

@ -24,9 +24,8 @@
#include "debug.h" #include "debug.h"
#if GNRC_IPV6_NIB_CONF_6LN #if GNRC_IPV6_NIB_CONF_6LN
#if ENABLE_DEBUG
static char addr_str[IPV6_ADDR_MAX_STR_LEN]; static char addr_str[IPV6_ADDR_MAX_STR_LEN];
#endif
extern void _handle_search_rtr(gnrc_netif_t *netif); extern void _handle_search_rtr(gnrc_netif_t *netif);

View File

@ -23,9 +23,8 @@
#include "debug.h" #include "debug.h"
#if GNRC_IPV6_NIB_CONF_6LR #if GNRC_IPV6_NIB_CONF_6LR
#if ENABLE_DEBUG
static char addr_str[IPV6_ADDR_MAX_STR_LEN]; static char addr_str[IPV6_ADDR_MAX_STR_LEN];
#endif
static uint8_t _update_nce_ar_state(const sixlowpan_nd_opt_ar_t *aro, static uint8_t _update_nce_ar_state(const sixlowpan_nd_opt_ar_t *aro,
_nib_onl_entry_t *nce) _nib_onl_entry_t *nce)
@ -38,12 +37,12 @@ static uint8_t _update_nce_ar_state(const sixlowpan_nd_opt_ar_t *aro,
_set_ar_state(nce, _set_ar_state(nce,
GNRC_IPV6_NIB_NC_INFO_AR_STATE_REGISTERED); GNRC_IPV6_NIB_NC_INFO_AR_STATE_REGISTERED);
DEBUG("nib: Successfully registered %s\n", DEBUG("nib: Successfully registered %s\n",
ipv6_addr_to_str(addr_str, &ipv6->src, sizeof(addr_str))); ipv6_addr_to_str(addr_str, &nce->ipv6, sizeof(addr_str)));
return SIXLOWPAN_ND_STATUS_SUCCESS; return SIXLOWPAN_ND_STATUS_SUCCESS;
} }
else { else {
DEBUG("nib: Could not register %s, neighbor cache was full\n", DEBUG("nib: Could not register %s, neighbor cache was full\n",
ipv6_addr_to_str(addr_str, &ipv6->src, sizeof(addr_str))); ipv6_addr_to_str(addr_str, &nce->ipv6, sizeof(addr_str)));
return SIXLOWPAN_ND_STATUS_NC_FULL; return SIXLOWPAN_ND_STATUS_NC_FULL;
} }
} }

View File

@ -28,9 +28,7 @@
#define ENABLE_DEBUG (0) #define ENABLE_DEBUG (0)
#include "debug.h" #include "debug.h"
#if ENABLE_DEBUG
static char addr_str[IPV6_ADDR_MAX_STR_LEN]; static char addr_str[IPV6_ADDR_MAX_STR_LEN];
#endif
/** /**
* @brief Determines supposed link-layer address from interface and option * @brief Determines supposed link-layer address from interface and option

View File

@ -42,9 +42,7 @@ static _nib_dr_entry_t _def_routers[GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF];
static _nib_abr_entry_t _abrs[GNRC_IPV6_NIB_ABR_NUMOF]; static _nib_abr_entry_t _abrs[GNRC_IPV6_NIB_ABR_NUMOF];
#endif /* GNRC_IPV6_NIB_CONF_MULTIHOP_P6C */ #endif /* GNRC_IPV6_NIB_CONF_MULTIHOP_P6C */
#if ENABLE_DEBUG
static char addr_str[IPV6_ADDR_MAX_STR_LEN]; static char addr_str[IPV6_ADDR_MAX_STR_LEN];
#endif
mutex_t _nib_mutex = MUTEX_INIT; mutex_t _nib_mutex = MUTEX_INIT;
evtimer_msg_t _nib_evtimer; evtimer_msg_t _nib_evtimer;

View File

@ -27,9 +27,7 @@
#include "debug.h" #include "debug.h"
#if GNRC_IPV6_NIB_CONF_ROUTER #if GNRC_IPV6_NIB_CONF_ROUTER
#if ENABLE_DEBUG
static char addr_str[IPV6_ADDR_MAX_STR_LEN]; static char addr_str[IPV6_ADDR_MAX_STR_LEN];
#endif
static void _snd_ra(gnrc_netif_t *netif, const ipv6_addr_t *dst, static void _snd_ra(gnrc_netif_t *netif, const ipv6_addr_t *dst,
bool final, _nib_abr_entry_t *abr); bool final, _nib_abr_entry_t *abr);

View File

@ -39,9 +39,7 @@
#include "xtimer.h" #include "xtimer.h"
#endif #endif
#if ENABLE_DEBUG
static char addr_str[IPV6_ADDR_MAX_STR_LEN]; static char addr_str[IPV6_ADDR_MAX_STR_LEN];
#endif
#if GNRC_IPV6_NIB_CONF_QUEUE_PKT #if GNRC_IPV6_NIB_CONF_QUEUE_PKT
static gnrc_pktqueue_t _queue_pool[GNRC_IPV6_NIB_NUMOF]; static gnrc_pktqueue_t _queue_pool[GNRC_IPV6_NIB_NUMOF];
@ -418,8 +416,8 @@ static void _handle_rtr_sol(gnrc_netif_t *netif, const ipv6_hdr_t *ipv6,
netif->pid); netif->pid);
DEBUG(" - IP Hop Limit: %u (should be 255)\n", ipv6->hl); DEBUG(" - IP Hop Limit: %u (should be 255)\n", ipv6->hl);
DEBUG(" - ICMP code: %u (should be 0)\n", rtr_sol->code); DEBUG(" - ICMP code: %u (should be 0)\n", rtr_sol->code);
DEBUG(" - ICMP length: %u (should > %u)\n", icmpv6_len, DEBUG(" - ICMP length: %u (should > %u)\n", (unsigned)icmpv6_len,
sizeof(ndp_rtr_sol_t)); (unsigned)sizeof(ndp_rtr_sol_t));
return; return;
} }
/* pre-check option length */ /* pre-check option length */
@ -529,7 +527,7 @@ static void _handle_rtr_adv(gnrc_netif_t *netif, const ipv6_hdr_t *ipv6,
DEBUG(" - IP Hop Limit: %u (should be 255)\n", ipv6->hl); DEBUG(" - IP Hop Limit: %u (should be 255)\n", ipv6->hl);
DEBUG(" - ICMP code: %u (should be 0)\n", rtr_adv->code); DEBUG(" - ICMP code: %u (should be 0)\n", rtr_adv->code);
DEBUG(" - ICMP length: %u (should > %u)\n", (unsigned)icmpv6_len, DEBUG(" - ICMP length: %u (should > %u)\n", (unsigned)icmpv6_len,
sizeof(ndp_rtr_adv_t)); (unsigned)sizeof(ndp_rtr_adv_t));
DEBUG(" - Source address: %s (should be link-local)\n", DEBUG(" - Source address: %s (should be link-local)\n",
ipv6_addr_to_str(addr_str, &ipv6->src, sizeof(addr_str))); ipv6_addr_to_str(addr_str, &ipv6->src, sizeof(addr_str)));
DEBUG(" - Router lifetime: %u (should be <= 9000 on non-6LN)\n", DEBUG(" - Router lifetime: %u (should be <= 9000 on non-6LN)\n",
@ -793,8 +791,8 @@ static void _handle_nbr_sol(gnrc_netif_t *netif, const ipv6_hdr_t *ipv6,
DEBUG("nib: Received neighbor solicitation is invalid. Discarding silently\n"); DEBUG("nib: Received neighbor solicitation is invalid. Discarding silently\n");
DEBUG(" - IP Hop Limit: %u (should be 255)\n", ipv6->hl); DEBUG(" - IP Hop Limit: %u (should be 255)\n", ipv6->hl);
DEBUG(" - ICMP code: %u (should be 0)\n", nbr_sol->code); DEBUG(" - ICMP code: %u (should be 0)\n", nbr_sol->code);
DEBUG(" - ICMP length: %u (should > %u)\n", icmpv6_len, DEBUG(" - ICMP length: %u (should > %u)\n", (unsigned)icmpv6_len,
sizeof(ndp_nbr_sol_t)); (unsigned)sizeof(ndp_nbr_sol_t));
DEBUG(" - Target address: %s (should not be multicast)\n", DEBUG(" - Target address: %s (should not be multicast)\n",
ipv6_addr_to_str(addr_str, &nbr_sol->tgt, sizeof(addr_str))); ipv6_addr_to_str(addr_str, &nbr_sol->tgt, sizeof(addr_str)));
DEBUG(" - Source address: %s\n", DEBUG(" - Source address: %s\n",
@ -905,8 +903,8 @@ static void _handle_nbr_adv(gnrc_netif_t *netif, const ipv6_hdr_t *ipv6,
DEBUG("nib: Received neighbor advertisement is invalid. Discarding silently\n"); DEBUG("nib: Received neighbor advertisement is invalid. Discarding silently\n");
DEBUG(" - IP Hop Limit: %u (should be 255)\n", ipv6->hl); DEBUG(" - IP Hop Limit: %u (should be 255)\n", ipv6->hl);
DEBUG(" - ICMP code: %u (should be 0)\n", nbr_adv->code); DEBUG(" - ICMP code: %u (should be 0)\n", nbr_adv->code);
DEBUG(" - ICMP length: %u (should > %u)\n", icmpv6_len, DEBUG(" - ICMP length: %u (should > %u)\n", (unsigned)icmpv6_len,
sizeof(ndp_nbr_adv_t)); (unsigned)sizeof(ndp_nbr_adv_t));
DEBUG(" - Target address: %s (should not be multicast)\n", DEBUG(" - Target address: %s (should not be multicast)\n",
ipv6_addr_to_str(addr_str, &nbr_adv->tgt, sizeof(addr_str))); ipv6_addr_to_str(addr_str, &nbr_adv->tgt, sizeof(addr_str)));
DEBUG(" - Destination address: %s\n", DEBUG(" - Destination address: %s\n",