]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- For #762: Formatting.
authorGeorge Thessalonikefs <george@nlnetlabs.nl>
Fri, 4 Aug 2023 17:03:23 +0000 (19:03 +0200)
committerGeorge Thessalonikefs <george@nlnetlabs.nl>
Fri, 4 Aug 2023 17:03:23 +0000 (19:03 +0200)
daemon/worker.c
util/data/msgencode.c
util/data/msgencode.h

index 47d29ce91c5008411e4d1afa9baac64afa6a8652..a92f1023b243e8a2fd756964f4632e32a6d11f47 100644 (file)
@@ -1477,8 +1477,8 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
                        edns.opt_list_out = NULL;
                        edns.opt_list_inplace_cb_out = NULL;
                        verbose(VERB_ALGO, "query with bad edns version.");
-                       log_addr( VERB_CLIENT, "from",&repinfo->remote_addr
-                                                    , repinfo->remote_addrlen);
+                       log_addr(VERB_CLIENT, "from", &repinfo->client_addr,
+                               repinfo->client_addrlen);
                        extended_error_encode(c->buffer, EDNS_RCODE_BADVERS, &qinfo,
                                *(uint16_t*)(void *)sldns_buffer_begin(c->buffer),
                                sldns_buffer_read_u16_at(c->buffer, 2), 0, &edns);
@@ -1494,17 +1494,18 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
                        edns.udp_size = NORMAL_UDP_SIZE;
                }
        }
+
        /* "if, else if" sequence below deals with downstream DNS Cookies */
-       if (acl != acl_allow_cookie)
+       if(acl != acl_allow_cookie)
                ; /* pass; No cookie downstream processing whatsoever */
 
-       else if (edns.cookie_valid)
+       else if(edns.cookie_valid)
                ; /* pass; Valid cookie is good! */
 
-       else if (c->type != comm_udp)
+       else if(c->type != comm_udp)
                ; /* pass; Stateful transport */
 
-       else if (edns.cookie_present) {
+       else if(edns.cookie_present) {
                /* Cookie present, but not valid: Cookie was bad! */
                extended_error_encode(c->buffer,
                        LDNS_EXT_RCODE_BADCOOKIE, &qinfo,
@@ -1515,7 +1516,7 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
                regional_free_all(worker->scratchpad);
                goto send_reply;
        } else {
-               /* Cookie requered, but no cookie present on UDP */
+               /* Cookie required, but no cookie present on UDP */
                verbose(VERB_ALGO, "worker request: "
                        "need cookie or stateful transport");
                log_addr(VERB_ALGO, "from",&repinfo->remote_addr
@@ -1532,6 +1533,7 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
                regional_free_all(worker->scratchpad);
                goto send_reply;
        }
+
        if(edns.udp_size > worker->daemon->cfg->max_udp_size &&
                c->type == comm_udp) {
                verbose(VERB_QUERY,
index d832ddc91ddb02ae6931481051c156ce446125bb..ec93ca071dae5d07a30ce6a8919e3e448418d43d 100644 (file)
@@ -958,9 +958,10 @@ qinfo_query_encode(sldns_buffer* pkt, struct query_info* qinfo)
        sldns_buffer_flip(pkt);
 }
 
-void 
-extended_error_encode(sldns_buffer* buf, uint16_t rcode, struct query_info* qinfo,
-       uint16_t qid, uint16_t qflags, uint16_t xflags, struct edns_data* edns)
+void
+extended_error_encode(sldns_buffer* buf, uint16_t rcode,
+       struct query_info* qinfo, uint16_t qid, uint16_t qflags,
+       uint16_t xflags, struct edns_data* edns)
 {
        uint16_t flags;
 
@@ -1003,11 +1004,10 @@ extended_error_encode(sldns_buffer* buf, uint16_t rcode, struct query_info* qinf
        }
 }
 
-void 
+void
 error_encode(sldns_buffer* buf, int r, struct query_info* qinfo,
        uint16_t qid, uint16_t qflags, struct edns_data* edns)
 {
-       extended_error_encode(buf, (r & 0x000F), qinfo, qid, qflags
-                                , (r & 0xFFF0), edns);
+       extended_error_encode(buf, (r & 0x000F), qinfo, qid, qflags,
+               (r & 0xFFF0), edns);
 }
-
index 1b37ca87092b8bb1a6778eb4dfdb793fe372287e..b42dc502914144d906de7a84a342308c25548993 100644 (file)
@@ -116,7 +116,7 @@ uint16_t calc_edns_field_size(struct edns_data* edns);
  */
 void attach_edns_record(struct sldns_buffer* pkt, struct edns_data* edns);
 
-/** 
+/**
  * Encode an error. With QR and RA set.
  *
  * @param pkt: where to store the packet.
@@ -130,7 +130,7 @@ void attach_edns_record(struct sldns_buffer* pkt, struct edns_data* edns);
 void error_encode(struct sldns_buffer* pkt, int r, struct query_info* qinfo,
        uint16_t qid, uint16_t qflags, struct edns_data* edns);
 
-/** 
+/**
  * Encode an extended error. With QR and RA set.
  *
  * @param pkt: where to store the packet.
@@ -141,7 +141,7 @@ void error_encode(struct sldns_buffer* pkt, int r, struct query_info* qinfo,
  * @param xflags: extra flags to set (such as for example BIT_AA and/or BIT_TC)
  * @param edns: if not NULL, this is the query edns info,
  *     and an edns reply is attached. Only attached if EDNS record fits reply.
- *      Without edns extended errors (i.e. > 15 )will not be conveyed.
+ *     Without edns extended errors (i.e. > 15) will not be conveyed.
  */
 void extended_error_encode(struct sldns_buffer* pkt, uint16_t rcode,
        struct query_info* qinfo, uint16_t qid, uint16_t qflags,