summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/control.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2022-02-04 12:01:34 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2022-02-04 12:01:34 +0000
commitb3ef3f2eef54812d84da4fef8e1030dc9a857b75 (patch)
tree70724fc80ca17aeb428568a00c8c0e18cde87246 /usr.sbin/bgpd/control.c
parent0719e0e4feeb5e454c9e2543bf4483332990cb48 (diff)
Rename sockaddr_un sun to sa_un since sun is defined on illumos systems.
OK dlg@
Diffstat (limited to 'usr.sbin/bgpd/control.c')
-rw-r--r--usr.sbin/bgpd/control.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/usr.sbin/bgpd/control.c b/usr.sbin/bgpd/control.c
index 844a05e5b25..2b73a481b9d 100644
--- a/usr.sbin/bgpd/control.c
+++ b/usr.sbin/bgpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.105 2021/04/27 15:34:18 claudio Exp $ */
+/* $OpenBSD: control.c,v 1.106 2022/02/04 12:01:12 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -42,19 +42,19 @@ ssize_t imsg_read_nofd(struct imsgbuf *);
int
control_check(char *path)
{
- struct sockaddr_un sun;
+ struct sockaddr_un sa_un;
int fd;
- bzero(&sun, sizeof(sun));
- sun.sun_family = AF_UNIX;
- strlcpy(sun.sun_path, path, sizeof(sun.sun_path));
+ bzero(&sa_un, sizeof(sa_un));
+ sa_un.sun_family = AF_UNIX;
+ strlcpy(sa_un.sun_path, path, sizeof(sa_un.sun_path));
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0)) == -1) {
log_warn("%s: socket", __func__);
return (-1);
}
- if (connect(fd, (struct sockaddr *)&sun, sizeof(sun)) == 0) {
+ if (connect(fd, (struct sockaddr *)&sa_un, sizeof(sa_un)) == 0) {
log_warnx("control socket %s already in use", path);
close(fd);
return (-1);
@@ -68,7 +68,7 @@ control_check(char *path)
int
control_init(int restricted, char *path)
{
- struct sockaddr_un sun;
+ struct sockaddr_un sa_un;
int fd;
mode_t old_umask, mode;
@@ -78,10 +78,10 @@ control_init(int restricted, char *path)
return (-1);
}
- bzero(&sun, sizeof(sun));
- sun.sun_family = AF_UNIX;
- if (strlcpy(sun.sun_path, path, sizeof(sun.sun_path)) >=
- sizeof(sun.sun_path)) {
+ bzero(&sa_un, sizeof(sa_un));
+ sa_un.sun_family = AF_UNIX;
+ if (strlcpy(sa_un.sun_path, path, sizeof(sa_un.sun_path)) >=
+ sizeof(sa_un.sun_path)) {
log_warn("control_init: socket name too long");
close(fd);
return (-1);
@@ -102,7 +102,7 @@ control_init(int restricted, char *path)
mode = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP;
}
- if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
+ if (bind(fd, (struct sockaddr *)&sa_un, sizeof(sa_un)) == -1) {
log_warn("control_init: bind: %s", path);
close(fd);
umask(old_umask);
@@ -159,12 +159,12 @@ control_accept(int listenfd, int restricted)
{
int connfd;
socklen_t len;
- struct sockaddr_un sun;
+ struct sockaddr_un sa_un;
struct ctl_conn *ctl_conn;
- len = sizeof(sun);
+ len = sizeof(sa_un);
if ((connfd = accept4(listenfd,
- (struct sockaddr *)&sun, &len,
+ (struct sockaddr *)&sa_un, &len,
SOCK_NONBLOCK | SOCK_CLOEXEC)) == -1) {
if (errno == ENFILE || errno == EMFILE) {
pauseaccept = getmonotime();