]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Remove unused whitespace, add missing header change, make it compile
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 9 Dec 2020 10:13:58 +0000 (11:13 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 9 Dec 2020 10:13:58 +0000 (11:13 +0100)
dnstap/dnstap.c
services/listen_dnsport.c
services/listen_dnsport.h
services/outside_network.c
util/net_help.c
util/netevent.c
util/netevent.h

index 2ee269be35f750ac0356012318fd29f1022396c3..e1abfeeb3d48f4daf647f8961efe42793a39ea12 100644 (file)
@@ -345,7 +345,7 @@ dt_msg_fill_net(struct dt_msg *dm,
 
        /*
         * This block is to fill second set of fields in DNSTAP-message defined as request_/response_ names.
-        * Additional responsive structure is: struct sockaddr_storage *rs 
+        * Additional responsive structure is: struct sockaddr_storage *rs
         */
         if (rs->ss_family == AF_INET6) {
                 struct sockaddr_in6 *r = (struct sockaddr_in6 *) rs;
index 02d44fcba26751dad279721a3891a380a4b74055..e8b8fdbd6184c930783b6b6b8b05afc6e0f757bd 100644 (file)
@@ -1215,12 +1215,12 @@ ports_create_if(const char* ifname, int do_auto, int do_udp, int do_tcp,
                }
        }
        if(do_tcp) {
-               ub_sock = malloc(sizeof(struct unbound_socket));
-               if(!ub_sock)
-                       return 0;
                int is_ssl = if_is_ssl(ifname, port, ssl_port,
                        tls_additional_port);
                enum listen_type port_type;
+               ub_sock = malloc(sizeof(struct unbound_socket));
+               if(!ub_sock)
+                       return 0;
                if(is_ssl)
                        port_type = listen_type_ssl;
                else if(is_https)
index 96feea66707134c2034b8b670a79d0b82d8a584d..82f0d9ec6411629909b0066c05da589f52a46050 100644 (file)
@@ -112,7 +112,7 @@ struct unbound_socket {
         int                     s;
        /** address family (AF_INET/IF_INET6) */
         int                     fam;
-        /** descriptor returned by accept() syscall for further usage. TODO: actually it might be useless here unlike in NSD where we have no comm_points mechanism with callback pointers for every created communication point */   
+        /** descriptor returned by accept() syscall for further usage. TODO: actually it might be useless here unlike in NSD where we have no comm_points mechanism with callback pointers for every created communication point */
         int                     tcp_read_fd;
 };
 
index 5d6b6c3c21b5b4a01f30cef79669ba3e523096b8..587f33a88c29cb52657d15c831dc64f56191cd33 100644 (file)
@@ -1923,7 +1923,7 @@ randomize_and_send_udp(struct pending* pend, sldns_buffer* packet, int timeout)
 #ifdef USE_DNSTAP
        /*
         * sending src (local service)/dst (upstream) addresses over DNSTAP
-        * TODO: right now there are no chances to get the src (local service) addr. So we will pass 0.0.0.0 (::) 
+        * TODO: right now there are no chances to get the src (local service) addr. So we will pass 0.0.0.0 (::)
         * to argument for dt_msg_send_outside_query()/dt_msg_send_outside_response() calls.
         * For the both UDP and TCP.
         */
@@ -1933,12 +1933,12 @@ randomize_and_send_udp(struct pending* pend, sldns_buffer* packet, int timeout)
                    if(addr_is_ip6(&sq->addr, sq->addrlen)) {
                        log_addr(VERB_ALGO, "from local addr", &sq->outnet->ip6_ifs->addr, sq->outnet->ip6_ifs->addrlen);
                        log_addr(VERB_ALGO, "request to upstream", &sq->addr, sq->addrlen);
-                       dt_msg_send_outside_query(sq->outnet->dtenv, &sq->addr, &sq->outnet->ip6_ifs->addr, 
+                       dt_msg_send_outside_query(sq->outnet->dtenv, &sq->addr, &sq->outnet->ip6_ifs->addr,
                                comm_tcp, sq->zone, sq->zonelen, packet);
                    } else {
                        log_addr(VERB_ALGO, "from local addr", &sq->outnet->ip4_ifs->addr, sq->outnet->ip4_ifs->addrlen);
                        log_addr(VERB_ALGO, "request to upstream", &sq->addr, sq->addrlen);
-                       dt_msg_send_outside_query(sq->outnet->dtenv, &sq->addr, &sq->outnet->ip4_ifs->addr, 
+                       dt_msg_send_outside_query(sq->outnet->dtenv, &sq->addr, &sq->outnet->ip4_ifs->addr,
                                comm_tcp, sq->zone, sq->zonelen, packet);
                    }
        }
@@ -2732,13 +2732,13 @@ serviced_tcp_callback(struct comm_point* c, void* arg, int error,
                if(addr_is_ip6(&sq->addr, sq->addrlen)) {
                        log_addr(VERB_ALGO, "response from upstream", &sq->addr, sq->addrlen);
                        log_addr(VERB_ALGO, "to local addr", &sq->outnet->ip6_ifs->addr, sq->outnet->ip6_ifs->addrlen);
-                       dt_msg_send_outside_response(sq->outnet->dtenv, &sq->addr, &sq->outnet->ip6_ifs->addr, 
+                       dt_msg_send_outside_response(sq->outnet->dtenv, &sq->addr, &sq->outnet->ip6_ifs->addr,
                          c->type, sq->zone, sq->zonelen, sq->qbuf, sq->qbuflen,
                          &sq->last_sent_time, sq->outnet->now_tv, c->buffer);
                } else {
                        log_addr(VERB_ALGO, "response from upstream", &sq->addr, sq->addrlen);
                        log_addr(VERB_ALGO, "to local addr", &sq->outnet->ip4_ifs->addr, sq->outnet->ip4_ifs->addrlen);
-                       dt_msg_send_outside_response(sq->outnet->dtenv, &sq->addr, &sq->outnet->ip4_ifs->addr, 
+                       dt_msg_send_outside_response(sq->outnet->dtenv, &sq->addr, &sq->outnet->ip4_ifs->addr,
                          c->type, sq->zone, sq->zonelen, sq->qbuf, sq->qbuflen,
                          &sq->last_sent_time, sq->outnet->now_tv, c->buffer);
                }
index 9745adcd390a7d48ad33c2a3fdc8a9c337b9f758..8732ea3df94464d6a1d27b7255c9802d447e6f92 100644 (file)
@@ -1632,7 +1632,7 @@ mk_local_addr(void* addr, u_short port, u_char family)
                struct in6_addr* v6addr = (struct in6_addr*)addr;
                struct sockaddr_in6 sin6;
                memset(&sin6, 0, sizeof(sin6));
-               sin6.sin6_len = sizeof(sin6);
+               /* sin6.sin6_len = sizeof(sin6); */
                sin6.sin6_family = AF_INET6;
                sin6.sin6_addr = *v6addr;
                sin6.sin6_port = port;
index e98b76933cd02cf40f05a6377db1efdb2e99b8ca..71337482765a5801c763e94ebfe63e63c88caca0 100644 (file)
@@ -411,13 +411,13 @@ static void p_ancil(const char* str, struct comm_reply* r)
 
        if(r->srctype == 6) {
 #ifdef IPV6_PKTINFO
-               char buf[1024];
-               if(inet_ntop(AF_INET6, &r->pktinfo.v6info.ipi6_addr, 
-                       buf, (socklen_t)sizeof(buf)) == 0) {
-                       (void)strlcpy(buf, "(inet_ntop error)", sizeof(buf));
-               }
-               buf[sizeof(buf)-1]=0;
-               log_info("%s: %s %d", str, buf, r->pktinfo.v6info.ipi6_ifindex);
+               char buf[1024];
+               if(inet_ntop(AF_INET6, &r->pktinfo.v6info.ipi6_addr, 
+                       buf, (socklen_t)sizeof(buf)) == 0) {
+                       (void)strlcpy(buf, "(inet_ntop error)", sizeof(buf));
+               }
+               buf[sizeof(buf)-1]=0;
+               log_info("%s: %s %d", str, buf, r->pktinfo.v6info.ipi6_ifindex);
 #endif
        } else if(r->srctype == 4) {
 #ifdef IP_PKTINFO
@@ -3971,7 +3971,7 @@ comm_point_send_reply(struct comm_reply *repinfo)
                                dst_addr = mk_local_addr(&((struct sockaddr_in6*)repinfo->c->socket->addr->ai_addr)->sin6_addr, ((struct sockaddr_in*)repinfo->c->socket->addr->ai_addr)->sin_port, repinfo->addr.ss_family);
                        log_addr(VERB_ALGO, "from local addr", dst_addr, sizeof(dst_addr));
                        log_addr(VERB_ALGO, "response to client", &repinfo->addr, repinfo->addrlen);
-                       dt_msg_send_client_response(repinfo->c->tcp_parent->dtenv, &repinfo->addr, dst_addr, repinfo->c->type, 
+                       dt_msg_send_client_response(repinfo->c->tcp_parent->dtenv, &repinfo->addr, dst_addr, repinfo->c->type,
                                ( repinfo->c->tcp_req_info? repinfo->c->tcp_req_info->spool_buffer: repinfo->c->buffer ));
                        if(dst_addr)
                                free(dst_addr);
index f43f0f49f89056e67f9d3628b6323a9ba85e26e4..c48359ec40cb5c56aa9d6a4f9f040d069d83df69 100644 (file)
@@ -554,7 +554,7 @@ struct comm_point* comm_point_create_tcp(struct comm_base* base,
        struct tcl_list* tcp_conn_limit,
        size_t bufsize, struct sldns_buffer* spoolbuf,
        enum listen_type port_type,
-       comm_point_callback_type* callback, void* callback_arg);
+       comm_point_callback_type* callback, void* callback_arg, struct unbound_socket* socket);
 
 /**
  * Create an outgoing TCP commpoint. No file descriptor is opened, left at -1.