diff --git a/core/net/ipv6/uip-ds6.c b/core/net/ipv6/uip-ds6.c index ff2ccd1db..99d882e98 100644 --- a/core/net/ipv6/uip-ds6.c +++ b/core/net/ipv6/uip-ds6.c @@ -83,7 +83,9 @@ static uip_ipaddr_t loc_fipaddr; /* Pointers used in this file */ static uip_ds6_addr_t *locaddr; static uip_ds6_maddr_t *locmaddr; +#if UIP_DS6_AADDR_NB static uip_ds6_aaddr_t *locaaddr; +#endif /* UIP_DS6_AADDR_NB */ static uip_ds6_prefix_t *locprefix; /*---------------------------------------------------------------------------*/ @@ -458,6 +460,7 @@ uip_ds6_maddr_lookup(const uip_ipaddr_t *ipaddr) uip_ds6_aaddr_t * uip_ds6_aaddr_add(uip_ipaddr_t *ipaddr) { +#if UIP_DS6_AADDR_NB if(uip_ds6_list_loop ((uip_ds6_element_t *)uip_ds6_if.aaddr_list, UIP_DS6_AADDR_NB, sizeof(uip_ds6_aaddr_t), ipaddr, 128, @@ -466,6 +469,7 @@ uip_ds6_aaddr_add(uip_ipaddr_t *ipaddr) uip_ipaddr_copy(&locaaddr->ipaddr, ipaddr); return locaaddr; } +#endif /* UIP_DS6_AADDR_NB */ return NULL; } @@ -483,11 +487,13 @@ uip_ds6_aaddr_rm(uip_ds6_aaddr_t *aaddr) uip_ds6_aaddr_t * uip_ds6_aaddr_lookup(uip_ipaddr_t *ipaddr) { +#if UIP_DS6_AADDR_NB if(uip_ds6_list_loop((uip_ds6_element_t *)uip_ds6_if.aaddr_list, UIP_DS6_AADDR_NB, sizeof(uip_ds6_aaddr_t), ipaddr, 128, (uip_ds6_element_t **)&locaaddr) == FOUND) { return locaaddr; } +#endif /* UIP_DS6_AADDR_NB */ return NULL; } diff --git a/core/net/ipv6/uip-ds6.h b/core/net/ipv6/uip-ds6.h index 9c470a1db..b111d0f5b 100644 --- a/core/net/ipv6/uip-ds6.h +++ b/core/net/ipv6/uip-ds6.h @@ -216,9 +216,15 @@ typedef struct uip_ds6_netif { uint32_t reachable_time; /* in msec */ uint32_t retrans_timer; /* in msec */ uint8_t maxdadns; +#if UIP_DS6_ADDR_NB uip_ds6_addr_t addr_list[UIP_DS6_ADDR_NB]; +#endif /* UIP_DS6_ADDR_NB */ +#if UIP_DS6_AADDR_NB uip_ds6_aaddr_t aaddr_list[UIP_DS6_AADDR_NB]; +#endif /* UIP_DS6_AADDR_NB */ +#if UIP_DS6_MADDR_NB uip_ds6_maddr_t maddr_list[UIP_DS6_MADDR_NB]; +#endif /* UIP_DS6_MADDR_NB */ } uip_ds6_netif_t; /** \brief Generic type for a DS6, to use a common loop though all DS */