-/* $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 <reyk@openbsd.org>
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;
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);
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);
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.
-/* $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 <reyk@openbsd.org>
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;
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)) {