From: W.C.A. Wijngaards Date: Wed, 24 Feb 2021 16:36:22 +0000 (+0100) Subject: Fix to use a simple pointer in the call of make_sock and make_sock_port. X-Git-Tag: release-1.13.2rc1~254^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cda81b7e487afa35fe723eb0f92c6ce6ea42f7c;p=thirdparty%2Funbound.git Fix to use a simple pointer in the call of make_sock and make_sock_port. --- diff --git a/services/listen_dnsport.c b/services/listen_dnsport.c index 9a95a8e32..ceccd6056 100644 --- a/services/listen_dnsport.c +++ b/services/listen_dnsport.c @@ -926,7 +926,7 @@ static int make_sock(int stype, const char* ifname, const char* port, struct addrinfo *hints, int v6only, int* noip6, size_t rcv, size_t snd, int* reuseport, int transparent, int tcp_mss, int nodelay, int freebind, - int use_systemd, int dscp, struct unbound_socket** ub_sock) + int use_systemd, int dscp, struct unbound_socket* ub_sock) { struct addrinfo *res = NULL; int r, s, inuse, noproto; @@ -969,9 +969,9 @@ make_sock(int stype, const char* ifname, const char* port, } } - (*ub_sock)->addr = res; - (*ub_sock)->s = s; - (*ub_sock)->fam = hints->ai_family; + ub_sock->addr = res; + ub_sock->s = s; + ub_sock->fam = hints->ai_family; return s; } @@ -981,7 +981,7 @@ static int make_sock_port(int stype, const char* ifname, const char* port, struct addrinfo *hints, int v6only, int* noip6, size_t rcv, size_t snd, int* reuseport, int transparent, int tcp_mss, int nodelay, int freebind, - int use_systemd, int dscp, struct unbound_socket** ub_sock) + int use_systemd, int dscp, struct unbound_socket* ub_sock) { char* s = strchr(ifname, '@'); if(s) { @@ -1177,7 +1177,7 @@ ports_create_if(const char* ifname, int do_auto, int do_udp, int do_tcp, return 0; if((s = make_sock_port(SOCK_DGRAM, ifname, port, hints, 1, &noip6, rcv, snd, reuseport, transparent, - tcp_mss, nodelay, freebind, use_systemd, dscp, &ub_sock)) == -1) { + tcp_mss, nodelay, freebind, use_systemd, dscp, ub_sock)) == -1) { free(ub_sock); if(noip6) { log_warn("IPv6 protocol not available"); @@ -1204,7 +1204,7 @@ ports_create_if(const char* ifname, int do_auto, int do_udp, int do_tcp, /* regular udp socket */ if((s = make_sock_port(SOCK_DGRAM, ifname, port, hints, 1, &noip6, rcv, snd, reuseport, transparent, - tcp_mss, nodelay, freebind, use_systemd, dscp, &ub_sock)) == -1) { + tcp_mss, nodelay, freebind, use_systemd, dscp, ub_sock)) == -1) { free(ub_sock); if(noip6) { log_warn("IPv6 protocol not available"); @@ -1236,7 +1236,7 @@ ports_create_if(const char* ifname, int do_auto, int do_udp, int do_tcp, port_type = listen_type_tcp; if((s = make_sock_port(SOCK_STREAM, ifname, port, hints, 1, &noip6, 0, 0, reuseport, transparent, tcp_mss, nodelay, - freebind, use_systemd, dscp, &ub_sock)) == -1) { + freebind, use_systemd, dscp, ub_sock)) == -1) { free(ub_sock); if(noip6) { /*log_warn("IPv6 protocol not available");*/