diff --git a/logsrvd/logsrvd.c b/logsrvd/logsrvd.c index 62e7d5e7a..0d7f11247 100644 --- a/logsrvd/logsrvd.c +++ b/logsrvd/logsrvd.c @@ -1565,7 +1565,7 @@ create_listener(struct listen_address *addr) #endif if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) sudo_warn("SO_REUSEADDR"); - if (bind(sock, &addr->sa_un.sa, addr->sa_len) == -1) { + if (bind(sock, &addr->sa_un.sa, addr->sa_size) == -1) { /* TODO: only warn once for IPv4 and IPv6 or disambiguate */ sudo_warn("%s (%s)", addr->sa_str, family); goto bad; diff --git a/logsrvd/logsrvd.h b/logsrvd/logsrvd.h index 2701eb1c1..01453efb4 100644 --- a/logsrvd/logsrvd.h +++ b/logsrvd/logsrvd.h @@ -131,7 +131,7 @@ struct listen_address { TAILQ_ENTRY(listen_address) entries; char *sa_str; union sockaddr_union sa_un; - socklen_t sa_len; + socklen_t sa_size; bool tls; }; TAILQ_HEAD(listen_address_list, listen_address); diff --git a/logsrvd/logsrvd_conf.c b/logsrvd/logsrvd_conf.c index ed8c8a3e1..7ccef0dc8 100644 --- a/logsrvd/logsrvd_conf.c +++ b/logsrvd/logsrvd_conf.c @@ -418,7 +418,7 @@ cb_listen_address(struct logsrvd_config *config, const char *str) goto done; } memcpy(&addr->sa_un, res->ai_addr, res->ai_addrlen); - addr->sa_len = res->ai_addrlen; + addr->sa_size = res->ai_addrlen; addr->tls = tls; TAILQ_INSERT_TAIL(&config->server.addresses, addr, entries); }