From: Álvaro Fernández Rojas Date: Tue, 4 Nov 2025 13:43:28 +0000 (+0100) Subject: treewide: remove whitespaces at EOL X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=f5684d5702006ec58f761aa24098f6a76462c205;p=project%2Fodhcp6c.git treewide: remove whitespaces at EOL Remove all whitespaces located at the end of the lines. Signed-off-by: Álvaro Fernández Rojas --- diff --git a/odhcp6c-example-script.sh b/odhcp6c-example-script.sh index 00d8056..7a6c25e 100755 --- a/odhcp6c-example-script.sh +++ b/odhcp6c-example-script.sh @@ -4,7 +4,7 @@ update_resolv() { local device="$1" local dns="$2" - + ( flock 9 grep -v "#odhcp6c:$device:" /etc/resolv.conf > /tmp/resolv.conf.tmp @@ -68,7 +68,7 @@ setup_interface () { done local prefix="{\"address\": \"$addr\", \"preferred\": $preferred, \"valid\": $valid $class $excluded}" - + if [ -z "$prefixpart" ]; then prefixpart="$prefix" else @@ -100,7 +100,7 @@ setup_interface () { entry="${entry#*,}" local valid="${entry%%,*}" - ip -6 address add "$addr" dev "$device" preferred_lft "$preferred" valid_lft "$valid" + ip -6 address add "$addr" dev "$device" preferred_lft "$preferred" valid_lft "$valid" done for entry in $RA_ROUTES; do diff --git a/src/config.c b/src/config.c index 61d5532..18b725a 100644 --- a/src/config.c +++ b/src/config.c @@ -318,7 +318,7 @@ bool config_set_auth_token(const char* token) free(config_dhcp.auth_token); config_dhcp.auth_token = strdup(token); - return config_dhcp.auth_token != NULL; + return config_dhcp.auth_token != NULL; } static int config_parse_opt_u8(const char *src, uint8_t **dst) diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 1443e4b..0aa9daf 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -1058,7 +1058,7 @@ static bool dhcpv6_response_is_valid(const void *buf, ssize_t len, } else if (otype == DHCPV6_OPT_AUTH) { struct dhcpv6_auth *r = (void*)&odata[-4]; if (auth_present) { - options_valid = false; + options_valid = false; continue; } @@ -2014,7 +2014,7 @@ int dhcpv6_send_request(enum dhcpv6_msg type) retx->delay_msec = 0; } } - + retx->is_retransmit = true; retx->rc = 0; retx->timeout = UINT32_MAX; @@ -2082,7 +2082,7 @@ int dhcpv6_send_request(enum dhcpv6_msg type) dhcpv6_send(type, retx->tr_id, elapsed / 10); retx->rc++; } - + if (dhcpv6_get_state() != DHCPV6_EXIT) dhcpv6_next_state(); @@ -2167,7 +2167,7 @@ int dhcpv6_state_processing(enum dhcpv6_msg type) if (retx->round_start >= retx->round_end || ret >=0 ) { if (retx->handler_finish) ret = retx->handler_finish(); - + if (ret < 0 && ((retx->timeout == UINT32_MAX) || (elapsed / 1000 < retx->timeout)) && (!retx->max_rc || retx->rc < retx->max_rc)) { retx->reply_ret = -1; diff --git a/src/odhcp6c.c b/src/odhcp6c.c index 91f429c..85d9891 100644 --- a/src/odhcp6c.c +++ b/src/odhcp6c.c @@ -41,7 +41,7 @@ #define DHCPV6_FD_INDEX 0 #define UBUS_FD_INDEX 1 - + #ifndef IN6_IS_ADDR_UNIQUELOCAL #define IN6_IS_ADDR_UNIQUELOCAL(a) \ ((((__const uint32_t *) (a))[0] & htonl (0xfe000000)) \ @@ -495,7 +495,7 @@ int main(_unused int argc, char* const argv[]) while (!terminate) { // Main logic int poll_res; - bool signalled = odhcp6c_signal_process(); + bool signalled = odhcp6c_signal_process(); switch (dhcpv6_get_state()) { case DHCPV6_INIT: @@ -536,7 +536,7 @@ int main(_unused int argc, char* const argv[]) } msg_type = DHCPV6_MSG_SOLICIT; - dhcpv6_send_request(msg_type); + dhcpv6_send_request(msg_type); break; case DHCPV6_ADVERT: @@ -586,18 +586,18 @@ int main(_unused int argc, char* const argv[]) msg_type = DHCPV6_MSG_UNKNOWN; dhcpv6_send_request(msg_type); break; - + case DHCPV6_BOUND_REPLY: if (res == DHCPV6_MSG_RENEW || res == DHCPV6_MSG_REBIND || res == DHCPV6_MSG_INFO_REQ) { msg_type = res; - dhcpv6_set_state(DHCPV6_RECONF); + dhcpv6_set_state(DHCPV6_RECONF); } else { dhcpv6_set_state(DHCPV6_RECONF_REPLY); } break; - case DHCPV6_RECONF: + case DHCPV6_RECONF: dhcpv6_send_request(msg_type); break; @@ -610,12 +610,12 @@ int main(_unused int argc, char* const argv[]) dhcpv6_set_state(mode == DHCPV6_STATELESS ? DHCPV6_INFO : DHCPV6_RENEW); } break; - + case DHCPV6_RENEW: msg_type = DHCPV6_MSG_RENEW; dhcpv6_send_request(msg_type); break; - + case DHCPV6_RENEW_REPLY: if (res > 0 ) { notify_state_change("updated", 0, false); @@ -642,7 +642,7 @@ int main(_unused int argc, char* const argv[]) msg_type = DHCPV6_MSG_REBIND; dhcpv6_send_request(msg_type); break; - + case DHCPV6_REBIND_REPLY: if (res < 0) { dhcpv6_set_state(DHCPV6_RESET); @@ -656,7 +656,7 @@ int main(_unused int argc, char* const argv[]) msg_type = DHCPV6_MSG_INFO_REQ; dhcpv6_send_request(msg_type); break; - + case DHCPV6_INFO_REPLY: dhcpv6_set_state(res < 0 ? DHCPV6_RESET : DHCPV6_BOUND); break; @@ -674,7 +674,7 @@ int main(_unused int argc, char* const argv[]) if (signal_usr1) dhcpv6_set_state(mode == DHCPV6_STATELESS ? DHCPV6_INFO : DHCPV6_RENEW); break; - + case DHCPV6_RENEW_PROCESSING: case DHCPV6_INFO_PROCESSING: res = dhcpv6_state_processing(msg_type); @@ -682,7 +682,7 @@ int main(_unused int argc, char* const argv[]) if (signal_usr1) signal_usr1 = false; // Acknowledged break; - + case DHCPV6_EXIT: odhcp6c_expire(false); diff --git a/src/odhcp6c.h b/src/odhcp6c.h index 7970a1e..0e873c4 100644 --- a/src/odhcp6c.h +++ b/src/odhcp6c.h @@ -182,14 +182,14 @@ enum dhcpv6_state { DHCPV6_ADVERT, DHCPV6_REQUEST, DHCPV6_REQUEST_PROCESSING, - DHCPV6_REPLY, + DHCPV6_REPLY, DHCPV6_BOUND, DHCPV6_BOUND_PROCESSING, DHCPV6_BOUND_REPLY, - DHCPV6_RECONF, + DHCPV6_RECONF, DHCPV6_RECONF_PROCESSING, - DHCPV6_RECONF_REPLY, - DHCPV6_RENEW, + DHCPV6_RECONF_REPLY, + DHCPV6_RENEW, DHCPV6_RENEW_PROCESSING, DHCPV6_RENEW_REPLY, DHCPV6_REBIND, @@ -366,7 +366,7 @@ struct dhcpv6_stats { uint64_t discarded_packets; uint64_t transmit_failures; }; - + enum odhcp6c_state { STATE_CLIENT_ID, STATE_SERVER_ID, diff --git a/src/ubus.c b/src/ubus.c index af73489..806a487 100644 --- a/src/ubus.c +++ b/src/ubus.c @@ -179,7 +179,7 @@ static struct ubus_method odhcp6c_object_methods[] = { UBUS_METHOD_NOARG("release", ubus_handle_release), }; -static struct ubus_object_type odhcp6c_object_type = +static struct ubus_object_type odhcp6c_object_type = UBUS_OBJECT_TYPE("odhcp6c", odhcp6c_object_methods); static struct ubus_object odhcp6c_object = { @@ -200,7 +200,7 @@ static void ubus_disconnect_cb(struct ubus_context *ubus) } } -char *ubus_init(const char* interface) +char *ubus_init(const char* interface) { int ret = 0; @@ -209,7 +209,7 @@ char *ubus_init(const char* interface) snprintf(ubus_name, 24, "odhcp6c.%s", interface); odhcp6c_object.name = ubus_name; - + ret = ubus_add_object(ubus, &odhcp6c_object); if (ret) { ubus_destroy(ubus); @@ -228,7 +228,7 @@ struct ubus_context *ubus_get_ctx(void) void ubus_destroy(struct ubus_context *ubus) { syslog(LOG_NOTICE, "Disconnecting from ubus"); - + if (ubus != NULL) ubus_free(ubus); ubus = NULL; @@ -242,7 +242,7 @@ static int ipv6_to_blob(const char *name, const struct in6_addr *addr, size_t cnt) { void *arr = blobmsg_open_array(&b, name); - + for (size_t i = 0; i < cnt; ++i) { char *buf = blobmsg_alloc_string_buffer(&b, NULL, INET6_ADDRSTRLEN); CHECK_ALLOC(buf); @@ -371,7 +371,7 @@ static int search_to_blob(const char *name, const uint8_t *start, size_t len) e = odhcp6c_next_entry(e)) { if (!e->valid) continue; - + buf = blobmsg_alloc_string_buffer(&b, NULL, e->auxlen+1); CHECK_ALLOC(buf); buf = mempcpy(buf, e->auxtarget, e->auxlen); @@ -590,7 +590,7 @@ static int states_to_blob(void) blobmsg_add_u32(&b, "RA_MTU", ra_get_mtu()); blobmsg_add_u32(&b, "RA_REACHABLE", ra_get_reachable()); blobmsg_add_u32(&b, "RA_RETRANSMIT", ra_get_retransmit()); - + buf = blobmsg_alloc_string_buffer(&b, "PASSTHRU", passthru_len * 2); CHECK_ALLOC(buf); script_hexlify(buf, passthru, passthru_len); diff --git a/src/ubus.h b/src/ubus.h index 5587a13..3c2ce97 100644 --- a/src/ubus.h +++ b/src/ubus.h @@ -68,7 +68,7 @@ char *ubus_init(const char* interface); struct ubus_context *ubus_get_ctx(void); -void ubus_destroy(struct ubus_context *ubus); +void ubus_destroy(struct ubus_context *ubus); int ubus_dhcp_event(const char *status); #endif /* _UBUS_H_ */