more sleepy florian knf issues
authorderaadt <deraadt@openbsd.org>
Mon, 3 Jun 2024 17:58:33 +0000 (17:58 +0000)
committerderaadt <deraadt@openbsd.org>
Mon, 3 Jun 2024 17:58:33 +0000 (17:58 +0000)
sbin/dhcpleased/engine.c
sbin/dhcpleased/frontend.c
sbin/dhcpleased/log.h
sbin/dhcpleased/parse.y
sbin/slaacd/engine.c
sbin/slaacd/frontend.c

index 99433ed..289dffd 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: engine.c,v 1.44 2024/06/02 12:39:26 florian Exp $     */
+/*     $OpenBSD: engine.c,v 1.45 2024/06/03 17:58:33 deraadt Exp $     */
 
 /*
  * Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
@@ -1819,7 +1819,7 @@ send_rdns_proposal(struct dhcpleased_iface *iface)
        imsg.rdomain = iface->rdomain;
        for (imsg.rdns_count = 0; imsg.rdns_count < MAX_RDNS_COUNT &&
                 iface->nameservers[imsg.rdns_count].s_addr != INADDR_ANY;
-            imsg.rdns_count++)
+           imsg.rdns_count++)
                ;
        memcpy(imsg.rdns, iface->nameservers, sizeof(imsg.rdns));
        engine_imsg_compose_main(IMSG_PROPOSE_RDNS, 0, &imsg, sizeof(imsg));
index b80b808..9dbe887 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: frontend.c,v 1.33 2024/01/26 21:14:08 jan Exp $       */
+/*     $OpenBSD: frontend.c,v 1.34 2024/06/03 17:58:33 deraadt Exp $   */
 
 /*
  * Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
@@ -797,7 +797,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);
index d638e72..eeb9236 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: log.h,v 1.3 2021/12/13 18:28:39 deraadt Exp $ */
+/*     $OpenBSD: log.h,v 1.4 2024/06/03 17:58:33 deraadt Exp $ */
 
 /*
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -44,16 +44,16 @@ __dead void fatal(const char *, ...)
 __dead void fatalx(const char *, ...)
            __attribute__((__format__ (printf, 1, 2)));
 #else
-#define log_init(x...)         do {} while(0)
-#define log_procinit(x...)     do {} while(0)
-#define log_setverbose(x...)   do {} while(0)
+#define log_init(x...)         do {} while (0)
+#define log_procinit(x...)     do {} while (0)
+#define log_setverbose(x...)   do {} while (0)
 #define log_getverbose(x...)   (0)
-#define log_warn(x...)         do {} while(0)
-#define log_warnx(x...)                do {} while(0)
-#define log_info(x...)         do {} while(0)
-#define log_debug(x...)                do {} while(0)
-#define logit(x...)            do {} while(0)
-#define vlog(x...)             do {} while(0)
+#define log_warn(x...)         do {} while (0)
+#define log_warnx(x...)                do {} while (0)
+#define log_info(x...)         do {} while (0)
+#define log_debug(x...)                do {} while (0)
+#define logit(x...)            do {} while (0)
+#define vlog(x...)             do {} while (0)
 #define fatal(x...)            exit(1)
 #define fatalx(x...)           exit(1)
 #endif /* SMALL */
index eeae428..4414684 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.8 2023/11/25 12:00:39 florian Exp $       */
+/*     $OpenBSD: parse.y,v 1.9 2024/06/03 17:58:33 deraadt Exp $       */
 
 /*
  * Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -57,7 +57,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;
index bb10368..fafeecf 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: engine.c,v 1.89 2024/04/21 17:33:05 florian Exp $     */
+/*     $OpenBSD: engine.c,v 1.90 2024/06/03 17:58:33 deraadt Exp $     */
 
 /*
  * Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@@ -782,7 +782,7 @@ send_interface_info(struct slaacd_iface *iface, pid_t pid)
        LIST_FOREACH(addr_proposal, &iface->addr_proposals, entries) {
                memset(&cei_addr_proposal, 0, sizeof(cei_addr_proposal));
                cei_addr_proposal.id = addr_proposal->id;
-               if(strlcpy(cei_addr_proposal.state,
+               if (strlcpy(cei_addr_proposal.state,
                    proposal_state_name(addr_proposal->state),
                    sizeof(cei_addr_proposal.state)) >=
                    sizeof(cei_addr_proposal.state))
@@ -811,7 +811,7 @@ send_interface_info(struct slaacd_iface *iface, pid_t pid)
        LIST_FOREACH(dfr_proposal, &iface->dfr_proposals, entries) {
                memset(&cei_dfr_proposal, 0, sizeof(cei_dfr_proposal));
                cei_dfr_proposal.id = dfr_proposal->id;
-               if(strlcpy(cei_dfr_proposal.state,
+               if (strlcpy(cei_dfr_proposal.state,
                    proposal_state_name(dfr_proposal->state),
                    sizeof(cei_dfr_proposal.state)) >=
                    sizeof(cei_dfr_proposal.state))
@@ -823,7 +823,7 @@ send_interface_info(struct slaacd_iface *iface, pid_t pid)
                    cei_dfr_proposal.addr));
                cei_dfr_proposal.router_lifetime =
                    dfr_proposal->router_lifetime;
-               if(strlcpy(cei_dfr_proposal.rpref,
+               if (strlcpy(cei_dfr_proposal.rpref,
                    rpref_name[dfr_proposal->rpref],
                    sizeof(cei_dfr_proposal.rpref)) >=
                    sizeof(cei_dfr_proposal.rpref))
@@ -840,7 +840,7 @@ send_interface_info(struct slaacd_iface *iface, pid_t pid)
        LIST_FOREACH(rdns_proposal, &iface->rdns_proposals, entries) {
                memset(&cei_rdns_proposal, 0, sizeof(cei_rdns_proposal));
                cei_rdns_proposal.id = rdns_proposal->id;
-               if(strlcpy(cei_rdns_proposal.state,
+               if (strlcpy(cei_rdns_proposal.state,
                    proposal_state_name(rdns_proposal->state),
                    sizeof(cei_rdns_proposal.state)) >=
                    sizeof(cei_rdns_proposal.state))
@@ -1524,7 +1524,7 @@ parse_ra(struct slaacd_iface *iface, struct imsg_ra *ra)
                        in6 = (struct in6_addr*) (p + 6);
                        for (i=0; i < (nd_opt_hdr->nd_opt_len - 1)/2; i++,
                            in6++) {
-                               if((rdns = calloc(1, sizeof(*rdns))) == NULL)
+                               if ((rdns = calloc(1, sizeof(*rdns))) == NULL)
                                        fatal("calloc");
                                memcpy(&rdns->rdns, in6, sizeof(rdns->rdns));
                                LIST_INSERT_HEAD(&radv->rdns_servers, rdns,
index 247dcd8..7e5024a 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: frontend.c,v 1.66 2024/02/11 21:29:12 bluhm Exp $     */
+/*     $OpenBSD: frontend.c,v 1.67 2024/06/03 17:58:33 deraadt Exp $   */
 
 /*
  * Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@@ -507,7 +507,7 @@ update_iface(uint32_t if_index, char* if_name)
        if (!(xflags & (IFXF_AUTOCONF6 | IFXF_AUTOCONF6TEMP)))
                return;
 
-       if((ifrdomain = get_ifrdomain(if_name)) == -1)
+       if ((ifrdomain = get_ifrdomain(if_name)) == -1)
                return;
 
        iface = get_iface_by_id(if_index);