my fingers cannot avoid KNF'ing as I review code
authorderaadt <deraadt@openbsd.org>
Wed, 14 Apr 2021 23:35:24 +0000 (23:35 +0000)
committerderaadt <deraadt@openbsd.org>
Wed, 14 Apr 2021 23:35:24 +0000 (23:35 +0000)
sbin/dhcpleased/dhcpleased.c
sbin/dhcpleased/engine.c
sbin/dhcpleased/frontend.c

index 942ba93..8815234 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dhcpleased.c,v 1.9 2021/03/27 18:10:38 florian Exp $  */
+/*     $OpenBSD: dhcpleased.c,v 1.10 2021/04/14 23:35:24 deraadt Exp $ */
 
 /*
  * Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
@@ -411,7 +411,7 @@ main_dispatch_frontend(int fd, short event, void *bula)
                                    "%lu", __func__, IMSG_DATA_SIZE(imsg));
                        memcpy(&if_index, imsg.data, sizeof(if_index));
                        open_bpfsock(if_index);
-                        break;
+                       break;
 #ifndef        SMALL
                case IMSG_CTL_LOG_VERBOSE:
                        if (IMSG_DATA_SIZE(imsg) != sizeof(verbose))
index e301c20..03d8e92 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: engine.c,v 1.12 2021/04/09 14:46:39 martijn Exp $     */
+/*     $OpenBSD: engine.c,v 1.13 2021/04/14 23:35:24 deraadt Exp $     */
 
 /*
  * Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
@@ -761,7 +761,7 @@ parse_dhcp(struct dhcpleased_iface *iface, struct imsg_dhcp *dhcp)
                                goto too_short;
                }
 
-               switch(dho) {
+               switch (dho) {
                case DHO_PAD:
                        if (log_getverbose() > 1)
                                log_debug("DHO_PAD");
@@ -913,7 +913,7 @@ parse_dhcp(struct dhcpleased_iface *iface, struct imsg_dhcp *dhcp)
                }
 
        }
-       while(rem != 0) {
+       while (rem != 0) {
                if (*p != DHO_PAD)
                        break;
                p++;
@@ -985,7 +985,7 @@ parse_dhcp(struct dhcpleased_iface *iface, struct imsg_dhcp *dhcp)
                        renewal_time = rebinding_time = 0;
                }
 
-               if(renewal_time == 0)
+               if (renewal_time == 0)
                        renewal_time = lease_time / 2;
                if (rebinding_time == 0)
                        rebinding_time = lease_time - (lease_time / 8);
index 349055f..e6ee7fd 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: frontend.c,v 1.9 2021/04/08 17:29:17 kn Exp $ */
+/*     $OpenBSD: frontend.c,v 1.10 2021/04/14 23:35:24 deraadt Exp $   */
 
 /*
  * Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
@@ -64,7 +64,7 @@ struct bpf_ev {
        uint8_t                  buf[BPFLEN];
 };
 
-struct iface           {
+struct iface {
        LIST_ENTRY(iface)        entries;
        struct bpf_ev            bpfev;
        struct imsg_ifinfo       ifinfo;
@@ -567,13 +567,13 @@ init_ifaces(void)
        if (getifaddrs(&ifap) != 0)
                fatal("getifaddrs");
 
-       for(ifnidx = ifnidxp; ifnidx->if_index != 0 && ifnidx->if_name != NULL;
+       for (ifnidx = ifnidxp; ifnidx->if_index != 0 && ifnidx->if_name != NULL;
            ifnidx++) {
                if_index = ifnidx->if_index;
                if_name = ifnidx->if_name;
                if ((flags = get_flags(if_name)) == -1)
                        continue;
-               if((xflags = get_xflags(if_name)) == -1)
+               if ((xflags = get_xflags(if_name)) == -1)
                        continue;
                if (!(xflags & IFXF_AUTOCONF4))
                        continue;
@@ -590,7 +590,7 @@ init_ifaces(void)
                        if (ifa->ifa_addr == NULL)
                                continue;
 
-                       switch(ifa->ifa_addr->sa_family) {
+                       switch (ifa->ifa_addr->sa_family) {
                        case AF_LINK: {
                                struct if_data          *if_data;
                                struct sockaddr_dl      *sdl;