From 41a0038f383248dfaae13dec6e656fefd4e728a8 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Mon, 30 Mar 2020 21:46:33 +0200 Subject: [PATCH] gnrc/uhcpc: Fix lines lengths --- .../gnrc/application_layer/uhcpc/gnrc_uhcpc.c | 50 +++++++++++-------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/sys/net/gnrc/application_layer/uhcpc/gnrc_uhcpc.c b/sys/net/gnrc/application_layer/uhcpc/gnrc_uhcpc.c index 7a71ffbabebae..0672d7ac55f84 100644 --- a/sys/net/gnrc/application_layer/uhcpc/gnrc_uhcpc.c +++ b/sys/net/gnrc/application_layer/uhcpc/gnrc_uhcpc.c @@ -42,16 +42,17 @@ static void set_interface_roles(void) gnrc_border_interface = dev; ipv6_addr_from_str(&addr, "fe80::2"); - gnrc_netapi_set(dev, NETOPT_IPV6_ADDR, 64 << 8, &addr, sizeof(addr)); + gnrc_netapi_set(dev, NETOPT_IPV6_ADDR, 64 << 8, &addr, + sizeof(addr)); ipv6_addr_from_str(&addr, "fe80::1"); gnrc_ipv6_nib_ft_add(&defroute, IPV6_ADDR_BIT_LEN, &addr, dev, 0); - /* Disable router advertisements on upstream interface. With this, the border - * router - * 1. Does not confuse the upstream router to add the border router to its - * default router list and - * 2. Solicits upstream Router Advertisements quicker to auto-configure its - * upstream global address. + /* Disable router advertisements on upstream interface. With this, + * the border router + * 1. Does not confuse the upstream router to add the border router + * to its default router list and + * 2. Solicits upstream Router Advertisements quicker to + * auto-configure its upstream global address. */ gnrc_ipv6_nib_change_rtr_adv_iface(netif, false); } @@ -64,7 +65,8 @@ static void set_interface_roles(void) } } - LOG_INFO("gnrc_uhcpc: Using %u as border interface and %u as wireless interface.\n", gnrc_border_interface, gnrc_wireless_interface); + LOG_INFO("gnrc_uhcpc: Using %u as border interface and %u as wireless " + "interface.\n", gnrc_border_interface, gnrc_wireless_interface); } static ipv6_addr_t _prefix; @@ -112,19 +114,22 @@ static void _update_6ctx(const ipv6_addr_t *prefix, uint8_t prefix_len) } #endif -void uhcp_handle_prefix(uint8_t *prefix, uint8_t prefix_len, uint16_t lifetime, uint8_t *src, uhcp_iface_t iface) +void uhcp_handle_prefix(uint8_t *prefix, uint8_t prefix_len, uint16_t lifetime, + uint8_t *src, uhcp_iface_t iface) { (void)lifetime; (void)src; eui64_t iid; if (!gnrc_wireless_interface) { - LOG_WARNING("gnrc_uhcpc: uhcp_handle_prefix(): received prefix, but don't know any wireless interface\n"); + LOG_WARNING("gnrc_uhcpc: uhcp_handle_prefix(): received prefix, but " + "don't know any wireless interface\n"); return; } if ((kernel_pid_t)iface != gnrc_border_interface) { - LOG_WARNING("gnrc_uhcpc: uhcp_handle_prefix(): received prefix from unexpected interface\n"); + LOG_WARNING("gnrc_uhcpc: uhcp_handle_prefix(): received prefix from " + "unexpected interface\n"); return; } @@ -133,14 +138,16 @@ void uhcp_handle_prefix(uint8_t *prefix, uint8_t prefix_len, uint16_t lifetime, ipv6_addr_set_aiid((ipv6_addr_t*)prefix, iid.uint8); } else { - LOG_WARNING("gnrc_uhcpc: uhcp_handle_prefix(): cannot get IID of wireless interface\n"); + LOG_WARNING("gnrc_uhcpc: uhcp_handle_prefix(): cannot get IID of " + "wireless interface\n"); return; } if ((_prefix_len == prefix_len) && (ipv6_addr_match_prefix(&_prefix, (ipv6_addr_t *)prefix) >= prefix_len)) { - LOG_WARNING("gnrc_uhcpc: uhcp_handle_prefix(): got same prefix again\n"); + LOG_WARNING("gnrc_uhcpc: uhcp_handle_prefix(): got same prefix " + "again\n"); #ifdef MODULE_GNRC_SIXLOWPAN_CTX if (gnrc_netif_is_6ln(gnrc_netif_get_by_pid(gnrc_wireless_interface))) { /* always update 6LoWPAN compression context so it does not time @@ -163,8 +170,8 @@ void uhcp_handle_prefix(uint8_t *prefix, uint8_t prefix_len, uint16_t lifetime, } memcpy(&_prefix, prefix, sizeof(_prefix)); _prefix_len = prefix_len; - gnrc_netapi_set(gnrc_wireless_interface, NETOPT_IPV6_ADDR, (prefix_len << 8), - prefix, sizeof(ipv6_addr_t)); + gnrc_netapi_set(gnrc_wireless_interface, NETOPT_IPV6_ADDR, + (prefix_len << 8), prefix, sizeof(ipv6_addr_t)); /* only configure 6Lo-ND features when wireless interface uses * 6Lo-ND */ if (gnrc_netif_is_6ln(gnrc_netif_get_by_pid(gnrc_wireless_interface))) { @@ -180,20 +187,23 @@ void uhcp_handle_prefix(uint8_t *prefix, uint8_t prefix_len, uint16_t lifetime, } #ifdef MODULE_GNRC_RPL gnrc_rpl_init(gnrc_wireless_interface); - gnrc_rpl_instance_t *inst = gnrc_rpl_instance_get(GNRC_RPL_DEFAULT_INSTANCE); + gnrc_rpl_instance_t *inst = gnrc_rpl_instance_get( + GNRC_RPL_DEFAULT_INSTANCE); if (inst) { gnrc_rpl_instance_remove(inst); } - gnrc_rpl_root_init(GNRC_RPL_DEFAULT_INSTANCE, (ipv6_addr_t*)prefix, false, false); + gnrc_rpl_root_init(GNRC_RPL_DEFAULT_INSTANCE, (ipv6_addr_t*)prefix, false, + false); #endif LOG_INFO("gnrc_uhcpc: uhcp_handle_prefix(): configured new prefix %s/%u\n", - ipv6_addr_to_str(addr_str, (ipv6_addr_t *)prefix, sizeof(addr_str)), - prefix_len); + ipv6_addr_to_str(addr_str, (ipv6_addr_t *)prefix, + sizeof(addr_str)), prefix_len); } extern void uhcp_client(uhcp_iface_t iface); -static char _uhcp_client_stack[THREAD_STACKSIZE_DEFAULT + THREAD_EXTRA_STACKSIZE_PRINTF]; +static char _uhcp_client_stack[THREAD_STACKSIZE_DEFAULT + + THREAD_EXTRA_STACKSIZE_PRINTF]; static msg_t _uhcp_msg_queue[4]; static void* uhcp_client_thread(void *arg)