From cb2a968a35857e36337388008db83cc34d0bdec4 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Thu, 12 Oct 2017 08:58:16 +0200 Subject: [PATCH] gnrc_uhcpc: fix dependencies \#7721 showed, that `posix` is required to include the `arpa/inet.h` header into the include path of an application using the `uhcpc` module. Additionally this PR makes the FIB an optional dependency of `gnrc_uhcpc`. --- Makefile.dep | 4 ++++ sys/net/gnrc/application_layer/uhcpc/gnrc_uhcpc.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile.dep b/Makefile.dep index c44dd293fd..33451cf3f5 100644 --- a/Makefile.dep +++ b/Makefile.dep @@ -45,6 +45,10 @@ ifneq (,$(filter gnrc_uhcpc,$(USEMODULE))) USEMODULE += fmt endif +ifneq (,$(filter uhcpc,$(USEMODULE))) + USEMODULE += posix +endif + ifneq (,$(filter nordic_softdevice_ble,$(USEPKG))) USEMODULE += softdevice_handler USEMODULE += ble_common diff --git a/sys/net/gnrc/application_layer/uhcpc/gnrc_uhcpc.c b/sys/net/gnrc/application_layer/uhcpc/gnrc_uhcpc.c index a881adc221..ffe594e22d 100644 --- a/sys/net/gnrc/application_layer/uhcpc/gnrc_uhcpc.c +++ b/sys/net/gnrc/application_layer/uhcpc/gnrc_uhcpc.c @@ -32,18 +32,21 @@ static void set_interface_roles(void) kernel_pid_t dev = ifs[i]; int is_wired = gnrc_netapi_get(dev, NETOPT_IS_WIRED, 0, NULL, 0); if ((!gnrc_border_interface) && (is_wired == 1)) { - ipv6_addr_t addr, defroute; + ipv6_addr_t addr; gnrc_border_interface = dev; ipv6_addr_from_str(&addr, "fe80::2"); gnrc_ipv6_netif_add_addr(dev, &addr, 64, GNRC_IPV6_NETIF_ADDR_FLAGS_UNICAST); - ipv6_addr_from_str(&defroute, "::"); +#ifdef MODULE_FIB + ipv6_addr_t defroute = IPV6_ADDR_UNSPECIFIED; + ipv6_addr_from_str(&addr, "fe80::1"); fib_add_entry(&gnrc_ipv6_fib_table, dev, defroute.u8, 16, 0x00, addr.u8, 16, 0, (uint32_t)FIB_LIFETIME_NO_EXPIRE); +#endif } else if ((!gnrc_wireless_interface) && (is_wired != 1)) { gnrc_wireless_interface = dev;