diff --git a/src/connections.c b/src/connections.c index f036dbf8..677533cc 100644 --- a/src/connections.c +++ b/src/connections.c @@ -137,7 +137,7 @@ static void connection_read_for_eos_plain(connection * const con) { * it will make the client not see all our output. */ ssize_t len; - const int type = con->dst_addr.plain.sa_family; + const int type = sock_addr_get_family(&con->dst_addr); char buf[16384]; do { len = fdevent_socket_read_discard(con->fd, buf, sizeof(buf), diff --git a/src/http-header-glue.c b/src/http-header-glue.c index 98f1b476..727dbc95 100644 --- a/src/http-header-glue.c +++ b/src/http-header-glue.c @@ -1685,7 +1685,7 @@ int http_cgi_headers (request_st * const r, http_cgi_opts * const opts, http_cgi rc |= cb(vdata, CONST_STR_LEN("SERVER_PORT"), buf, li_utostrn(buf,sizeof(buf),sock_addr_get_port(addr))); - switch (addr->plain.sa_family) { + switch (sock_addr_get_family(addr)) { case AF_INET: case AF_INET6: if (sock_addr_is_addr_wildcard(addr)) { diff --git a/src/mod_extforward.c b/src/mod_extforward.c index 1a6829c2..b9cf3831 100644 --- a/src/mod_extforward.c +++ b/src/mod_extforward.c @@ -1719,8 +1719,8 @@ static int mod_extforward_network_read (connection *con, union hap_PROXY_hdr hdr; log_error_st *errh; - int rc = hap_PROXY_recv(con->fd, &hdr, - con->dst_addr.plain.sa_family, SOCK_STREAM); + const int family = sock_addr_get_family(&con->dst_addr); + int rc = hap_PROXY_recv(con->fd, &hdr, family, SOCK_STREAM); switch (rc) { case 2: rc = mod_extforward_hap_PROXY_v2(con, &hdr); break; case 1: rc = mod_extforward_hap_PROXY_v1(con, &hdr); break; diff --git a/src/mod_magnet.c b/src/mod_magnet.c index f6f7656f..911092d7 100644 --- a/src/mod_magnet.c +++ b/src/mod_magnet.c @@ -512,7 +512,7 @@ static buffer *magnet_env_get_buffer_by_id(request_st * const r, int id) { const server_socket * const srv_socket = r->con->srv_socket; dest = r->tmp_buf; buffer_clear(dest); - switch (srv_socket->addr.plain.sa_family) { + switch (sock_addr_get_family(&srv_socket->addr)) { case AF_INET: case AF_INET6: if (sock_addr_is_addr_wildcard(&srv_socket->addr)) { diff --git a/src/mod_maxminddb.c b/src/mod_maxminddb.c index c9348850..7b376dc0 100644 --- a/src/mod_maxminddb.c +++ b/src/mod_maxminddb.c @@ -423,7 +423,7 @@ REQUEST_FUNC(mod_maxminddb_request_env_handler) { connection * const con = r->con; const sock_addr * const dst_addr = &con->dst_addr; - const int sa_family = dst_addr->plain.sa_family; + const int sa_family = sock_addr_get_family(dst_addr); if (sa_family != AF_INET && sa_family != AF_INET6) return HANDLER_GO_ON; plugin_config pconf;