From 3a2a6d8f603b553f4f496679664753d57edeebcb Mon Sep 17 00:00:00 2001 From: deraadt Date: Mon, 3 Jun 2024 17:58:33 +0000 Subject: [PATCH] more sleepy florian knf issues --- sbin/dhcpleased/engine.c | 4 ++-- sbin/dhcpleased/frontend.c | 4 ++-- sbin/dhcpleased/log.h | 20 ++++++++++---------- sbin/dhcpleased/parse.y | 4 ++-- sbin/slaacd/engine.c | 12 ++++++------ sbin/slaacd/frontend.c | 4 ++-- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/sbin/dhcpleased/engine.c b/sbin/dhcpleased/engine.c index 99433ed0500..289dffdf20a 100644 --- a/sbin/dhcpleased/engine.c +++ b/sbin/dhcpleased/engine.c @@ -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 @@ -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)); diff --git a/sbin/dhcpleased/frontend.c b/sbin/dhcpleased/frontend.c index b80b8081e03..9dbe88716c1 100644 --- a/sbin/dhcpleased/frontend.c +++ b/sbin/dhcpleased/frontend.c @@ -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 @@ -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); diff --git a/sbin/dhcpleased/log.h b/sbin/dhcpleased/log.h index d638e726934..eeb9236a910 100644 --- a/sbin/dhcpleased/log.h +++ b/sbin/dhcpleased/log.h @@ -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 @@ -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 */ diff --git a/sbin/dhcpleased/parse.y b/sbin/dhcpleased/parse.y index eeae4289e39..4414684e03c 100644 --- a/sbin/dhcpleased/parse.y +++ b/sbin/dhcpleased/parse.y @@ -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 @@ -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; diff --git a/sbin/slaacd/engine.c b/sbin/slaacd/engine.c index bb10368527b..fafeecf4d9d 100644 --- a/sbin/slaacd/engine.c +++ b/sbin/slaacd/engine.c @@ -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 @@ -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, diff --git a/sbin/slaacd/frontend.c b/sbin/slaacd/frontend.c index 247dcd885bb..7e5024a5c84 100644 --- a/sbin/slaacd/frontend.c +++ b/sbin/slaacd/frontend.c @@ -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 @@ -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); -- 2.20.1