From e84c6478e93c0b8ca7ba27dd59fcff2995af76ad Mon Sep 17 00:00:00 2001 From: tobhe Date: Sun, 4 Dec 2022 11:54:31 +0000 Subject: [PATCH] Rename sun to s_un for portability. ok patrick@ --- sbin/iked/control.c | 18 +++++++++--------- usr.sbin/ikectl/ikectl.c | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sbin/iked/control.c b/sbin/iked/control.c index f88b9bf806c..b76a545c5fb 100644 --- a/sbin/iked/control.c +++ b/sbin/iked/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.33 2022/09/19 20:54:02 tobhe Exp $ */ +/* $OpenBSD: control.c,v 1.34 2022/12/04 11:54:31 tobhe Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter @@ -77,7 +77,7 @@ int control_init(struct privsep *ps, struct control_sock *cs) { struct iked *env = ps->ps_env; - struct sockaddr_un sun; + struct sockaddr_un s_un; int fd; mode_t old_umask, mode; @@ -89,9 +89,9 @@ control_init(struct privsep *ps, struct control_sock *cs) return (-1); } - sun.sun_family = AF_UNIX; - if (strlcpy(sun.sun_path, cs->cs_name, - sizeof(sun.sun_path)) >= sizeof(sun.sun_path)) { + s_un.sun_family = AF_UNIX; + if (strlcpy(s_un.sun_path, cs->cs_name, + sizeof(s_un.sun_path)) >= sizeof(s_un.sun_path)) { log_warn("%s: %s name too long", __func__, cs->cs_name); close(fd); return (-1); @@ -112,7 +112,7 @@ control_init(struct privsep *ps, struct control_sock *cs) mode = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP; } - if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) { + if (bind(fd, (struct sockaddr *)&s_un, sizeof(s_un)) == -1) { log_warn("%s: bind: %s", __func__, cs->cs_name); close(fd); (void)umask(old_umask); @@ -159,16 +159,16 @@ control_accept(int listenfd, short event, void *arg) struct control_sock *cs = arg; int connfd; socklen_t len; - struct sockaddr_un sun; + struct sockaddr_un s_un; struct ctl_conn *c; event_add(&cs->cs_ev, NULL); if ((event & EV_TIMEOUT)) return; - len = sizeof(sun); + len = sizeof(s_un); if ((connfd = accept4(listenfd, - (struct sockaddr *)&sun, &len, SOCK_NONBLOCK)) == -1) { + (struct sockaddr *)&s_un, &len, SOCK_NONBLOCK)) == -1) { /* * Pause accept if we are out of file descriptors, or * libevent will haunt us here too. diff --git a/usr.sbin/ikectl/ikectl.c b/usr.sbin/ikectl/ikectl.c index 4eb3d8ee517..85bb31d8207 100644 --- a/usr.sbin/ikectl/ikectl.c +++ b/usr.sbin/ikectl/ikectl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ikectl.c,v 1.29 2022/12/03 22:34:35 tobhe Exp $ */ +/* $OpenBSD: ikectl.c,v 1.30 2022/12/04 11:54:31 tobhe Exp $ */ /* * Copyright (c) 2007-2013 Reyk Floeter @@ -158,7 +158,7 @@ ca_opt(struct parse_result *res) int main(int argc, char *argv[]) { - struct sockaddr_un sun; + struct sockaddr_un s_un; struct parse_result *res; struct imsg imsg; int ctl_sock; @@ -229,11 +229,11 @@ main(int argc, char *argv[]) if ((ctl_sock = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) err(1, "socket"); - bzero(&sun, sizeof(sun)); - sun.sun_family = AF_UNIX; - strlcpy(sun.sun_path, sock, sizeof(sun.sun_path)); + bzero(&s_un, sizeof(s_un)); + s_un.sun_family = AF_UNIX; + strlcpy(s_un.sun_path, sock, sizeof(s_un.sun_path)); reconnect: - if (connect(ctl_sock, (struct sockaddr *)&sun, sizeof(sun)) == -1) { + if (connect(ctl_sock, (struct sockaddr *)&s_un, sizeof(s_un)) == -1) { /* Keep retrying if running in monitor mode */ if (res->action == MONITOR && (errno == ENOENT || errno == ECONNREFUSED)) { -- 2.20.1