uip-ds6-nbr: introduce UIP_DS6_NBR_MAX_6ADDRS_PER_NBR
This commit is contained in:
parent
17aa75f0cf
commit
319b70345a
@ -149,6 +149,19 @@ uip_ds6_nbr_add(const uip_ipaddr_t *ipaddr, const uip_lladdr_t *lladdr,
|
||||
}
|
||||
}
|
||||
|
||||
if(list_length(nbr_entry->uip_ds6_nbrs) < UIP_DS6_NBR_MAX_6ADDRS_PER_NBR) {
|
||||
/* it has room to add another IPv6 address */
|
||||
} else {
|
||||
/*
|
||||
* it's already had the maximum number of IPv6 addresses; cannot
|
||||
* add another.
|
||||
*/
|
||||
LOG_ERR("%s: no room in nbr_entry for ", __func__);
|
||||
LOG_ERR_LLADDR((const linkaddr_t *)lladdr);
|
||||
LOG_ERR_("\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if((nbr = (uip_ds6_nbr_t *)memb_alloc(&uip_ds6_nbr_memb)) == NULL) {
|
||||
LOG_ERR("%s: cannot allocate a new uip_ds6_nbr\n", __func__);
|
||||
if(list_length(nbr_entry->uip_ds6_nbrs) == 0) {
|
||||
|
@ -75,6 +75,14 @@
|
||||
#define UIP_DS6_NBR_MULTI_IPV6_ADDRS 0
|
||||
#endif /* UIP_DS6_NBR_CONF_MULTI_IPV6_ADDRS */
|
||||
|
||||
/** \brief Set the maximum number of IPv6 addresses per link-layer
|
||||
* address */
|
||||
#ifdef UIP_DS6_NBR_CONF_MAX_6ADDRS_PER_NBR
|
||||
#define UIP_DS6_NBR_MAX_6ADDRS_PER_NBR UIP_DS6_NBR_CONF_MAX_6ADDRS_PER_NBR
|
||||
#else
|
||||
#define UIP_DS6_NBR_MAX_6ADDRS_PER_NBR 2
|
||||
#endif /* UIP_DS6_NBR_CONF_MAX_6ADDRS_PER_NBR */
|
||||
|
||||
/** \brief Set the maximum number of neighbor cache entries */
|
||||
#ifdef UIP_DS6_NBR_CONF_MAX_NEIGHBOR_CACHES
|
||||
#define UIP_DS6_NBR_MAX_NEIGHBOR_CACHES UIP_DS6_NBR_CONF_MAX_NEIGHBOR_CACHES
|
||||
|
Loading…
Reference in New Issue
Block a user