From 95ce3e7d2677ea508fb5c8635a25c7e62757ccac Mon Sep 17 00:00:00 2001 From: deraadt Date: Mon, 3 Jun 2024 15:53:26 +0000 Subject: [PATCH] more whitespace and knf --- sbin/dhcp6leased/dhcp6leased.c | 28 ++++++++++++++-------------- sbin/dhcp6leased/engine.c | 10 +++++----- sbin/dhcp6leased/frontend.c | 10 +++++----- sbin/dhcp6leased/parse.y | 4 ++-- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/sbin/dhcp6leased/dhcp6leased.c b/sbin/dhcp6leased/dhcp6leased.c index f5cbacb23b5..09478a29f59 100644 --- a/sbin/dhcp6leased/dhcp6leased.c +++ b/sbin/dhcp6leased/dhcp6leased.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcp6leased.c,v 1.8 2024/06/03 15:52:17 florian Exp $ */ +/* $OpenBSD: dhcp6leased.c,v 1.9 2024/06/03 15:53:26 deraadt Exp $ */ /* * Copyright (c) 2017, 2021, 2024 Florian Obser @@ -133,17 +133,17 @@ int main(int argc, char *argv[]) { struct event ev_sigint, ev_sigterm, ev_sighup; - int ch; - int debug = 0, engine_flag = 0, frontend_flag = 0; - int verbose = 0, no_action = 0; - char *saved_argv0; - int pipe_main2frontend[2]; - int pipe_main2engine[2]; - int frontend_routesock, rtfilter, lockfd; - int rtable_any = RTABLE_ANY; - char *csock = _PATH_CTRL_SOCKET; - int control_fd; - uint8_t *uuid; + int ch; + int debug = 0, engine_flag = 0, frontend_flag = 0; + int verbose = 0, no_action = 0; + char *saved_argv0; + int pipe_main2frontend[2]; + int pipe_main2engine[2]; + int frontend_routesock, rtfilter, lockfd; + int rtable_any = RTABLE_ANY; + char *csock = _PATH_CTRL_SOCKET; + int control_fd; + uint8_t *uuid; log_init(1, LOG_DAEMON); /* Log to stderr until daemonized. */ log_setverbose(1); @@ -883,11 +883,11 @@ merge_config(struct dhcp6leased_conf *conf, struct dhcp6leased_conf *xconf) /* Remove & discard existing interfaces. */ while ((iface_conf = SIMPLEQ_FIRST(&conf->iface_list)) != NULL) { SIMPLEQ_REMOVE_HEAD(&conf->iface_list, entry); - while((ia_conf = + while ((ia_conf = SIMPLEQ_FIRST(&iface_conf->iface_ia_list)) != NULL) { SIMPLEQ_REMOVE_HEAD(&iface_conf->iface_ia_list, entry); - while((pd_conf = + while ((pd_conf = SIMPLEQ_FIRST(&ia_conf->iface_pd_list)) != NULL) { SIMPLEQ_REMOVE_HEAD(&ia_conf->iface_pd_list, entry); diff --git a/sbin/dhcp6leased/engine.c b/sbin/dhcp6leased/engine.c index c55169714aa..0e059c19b00 100644 --- a/sbin/dhcp6leased/engine.c +++ b/sbin/dhcp6leased/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.6 2024/06/03 15:52:17 florian Exp $ */ +/* $OpenBSD: engine.c,v 1.7 2024/06/03 15:53:26 deraadt Exp $ */ /* * Copyright (c) 2017, 2021, 2024 Florian Obser @@ -725,7 +725,7 @@ parse_dhcp(struct dhcp6leased_iface *iface, struct imsg_dhcp *dhcp) dhcp_message_type2str(hdr.msg_type), hdr.xid[0], hdr.xid[1], hdr.xid[2]); - while(rem >= sizeof(struct dhcp_option_hdr)) { + while (rem >= sizeof(struct dhcp_option_hdr)) { memcpy(&opt_hdr, p, sizeof(struct dhcp_option_hdr)); opt_hdr.code = ntohs(opt_hdr.code); opt_hdr.len = ntohs(opt_hdr.len); @@ -871,7 +871,7 @@ parse_dhcp(struct dhcp6leased_iface *iface, struct imsg_dhcp *dhcp) state_transition(iface, IF_REQUESTING); break; case DHCPREPLY: - switch(iface->state) { + switch (iface->state) { case IF_REQUESTING: case IF_RENEWING: case IF_REBINDING: @@ -920,7 +920,7 @@ parse_ia_pd_options(uint8_t *p, size_t len, struct prefix *prefix) uint16_t status_code; char ntopbuf[INET6_ADDRSTRLEN], *visbuf; - while(len >= sizeof(struct dhcp_option_hdr)) { + while (len >= sizeof(struct dhcp_option_hdr)) { memcpy(&opt_hdr, p, sizeof(struct dhcp_option_hdr)); opt_hdr.code = ntohs(opt_hdr.code); opt_hdr.len = ntohs(opt_hdr.len); @@ -1071,7 +1071,7 @@ XXXX break; case IF_BOUND: iface->timo.tv_sec = iface->t1; - switch(old_state) { + switch (old_state) { case IF_REQUESTING: case IF_RENEWING: case IF_REBINDING: diff --git a/sbin/dhcp6leased/frontend.c b/sbin/dhcp6leased/frontend.c index b3e98c34e3a..d683a68239c 100644 --- a/sbin/dhcp6leased/frontend.c +++ b/sbin/dhcp6leased/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.7 2024/06/03 11:08:31 florian Exp $ */ +/* $OpenBSD: frontend.c,v 1.8 2024/06/03 15:53:26 deraadt Exp $ */ /* * Copyright (c) 2017, 2021, 2024 Florian Obser @@ -721,7 +721,7 @@ handle_route_message(struct rt_msghdr *rtm, struct sockaddr **rti_info) case RTM_IFANNOUNCE: ifan = (struct if_announcemsghdr *)rtm; if_index = ifan->ifan_index; - if (ifan->ifan_what == IFAN_DEPARTURE) { + if (ifan->ifan_what == IFAN_DEPARTURE) { frontend_imsg_compose_engine(IMSG_REMOVE_IF, 0, 0, &if_index, sizeof(if_index)); remove_iface(if_index); @@ -799,7 +799,7 @@ build_packet(uint8_t message_type, struct iface *iface, char *if_name) uint16_t request_option_code, elapsed_time; uint8_t *p; - switch(message_type) { + switch (message_type) { case DHCPSOLICIT: case DHCPREQUEST: case DHCPRENEW: @@ -827,7 +827,7 @@ build_packet(uint8_t message_type, struct iface *iface, char *if_name) memcpy(p, &duid, sizeof(struct dhcp_duid)); p += sizeof(struct dhcp_duid); - switch(message_type) { + switch (message_type) { case DHCPSOLICIT: case DHCPREBIND: break; @@ -866,7 +866,7 @@ build_packet(uint8_t message_type, struct iface *iface, char *if_name) memset(&iaprefix, 0, sizeof(struct dhcp_iaprefix)); - switch(message_type) { + switch (message_type) { case DHCPSOLICIT: iaprefix.prefix_len = ia_conf->prefix_len; break; diff --git a/sbin/dhcp6leased/parse.y b/sbin/dhcp6leased/parse.y index f2da857dc0b..0e8a50c7d28 100644 --- a/sbin/dhcp6leased/parse.y +++ b/sbin/dhcp6leased/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.5 2024/06/03 11:08:31 florian Exp $ */ +/* $OpenBSD: parse.y,v 1.6 2024/06/03 15:53:26 deraadt Exp $ */ /* * Copyright (c) 2018, 2024 Florian Obser @@ -56,7 +56,7 @@ static struct file { TAILQ_ENTRY(file) entry; FILE *stream; char *name; - size_t ungetpos; + size_t ungetpos; size_t ungetsize; u_char *ungetbuf; int eof_reached; -- 2.20.1