From 148e1ea7aa6df5e6049df8a892d4f06a47b36373 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 16 Jun 2016 11:04:07 +0300 Subject: [PATCH] net: Fix compilation when IPv6 is disabled Change-Id: If1c7b8e3befa48b405aa5f6d4d04a87c72afc5b5 Signed-off-by: Jukka Rissanen --- net/yaip/net_core.c | 3 +-- net/yaip/net_if.c | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/net/yaip/net_core.c b/net/yaip/net_core.c index a5e91f3d06..53837dfa10 100644 --- a/net/yaip/net_core.c +++ b/net/yaip/net_core.c @@ -42,9 +42,8 @@ #include "net_private.h" -#if defined(CONFIG_NET_IPV6) #include "icmpv6.h" -#endif +#include "ipv6.h" #if defined(CONFIG_NET_IPV4) #include "icmpv4.h" diff --git a/net/yaip/net_if.c b/net/yaip/net_if.c index cd26b9779b..c173eb4b3b 100644 --- a/net/yaip/net_if.c +++ b/net/yaip/net_if.c @@ -619,6 +619,7 @@ bool net_if_ipv4_addr_mask_cmp(struct net_if *iface, struct in6_addr *net_if_ipv6_get_ll(struct net_if *iface, enum net_addr_state addr_state) { +#if defined(CONFIG_NET_IPV6) int i; for (i = 0; i < NET_IF_MAX_IPV6_ADDR; i++) { @@ -632,6 +633,7 @@ struct in6_addr *net_if_ipv6_get_ll(struct net_if *iface, return &iface->ipv6.unicast[i].address.in6_addr; } } +#endif return NULL; } @@ -663,11 +665,13 @@ static inline uint8_t get_length(struct in6_addr *src, struct in6_addr *dst) static inline bool is_proper_ipv6_address(struct net_if_addr *addr) { +#if defined(CONFIG_NET_IPV6) if (addr->is_used && addr->addr_state == NET_ADDR_PREFERRED && addr->address.family == AF_INET6 && !net_is_ipv6_ll_addr(&addr->address.in6_addr)) { return true; } +#endif return false; }