more whitespace and knf
authorderaadt <deraadt@openbsd.org>
Mon, 3 Jun 2024 15:53:26 +0000 (15:53 +0000)
committerderaadt <deraadt@openbsd.org>
Mon, 3 Jun 2024 15:53:26 +0000 (15:53 +0000)
sbin/dhcp6leased/dhcp6leased.c
sbin/dhcp6leased/engine.c
sbin/dhcp6leased/frontend.c
sbin/dhcp6leased/parse.y

index f5cbacb..09478a2 100644 (file)
@@ -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 <florian@openbsd.org>
@@ -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);
index c551697..0e059c1 100644 (file)
@@ -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 <florian@openbsd.org>
@@ -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:
index b3e98c3..d683a68 100644 (file)
@@ -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 <florian@openbsd.org>
@@ -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;
index f2da857..0e8a50c 100644 (file)
@@ -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 <florian@openbsd.org>
@@ -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;