]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
RPZ: fix for c89
authormb <mb@64k.by>
Tue, 3 Nov 2020 14:45:26 +0000 (15:45 +0100)
committermb <mb@64k.by>
Tue, 3 Nov 2020 14:45:26 +0000 (15:45 +0100)
services/mesh.c

index a255595e86822fe85bad3e23886c2a7edfda207d..ec2e940a423cf24cfff7d2b4d139d831940562bd 100644 (file)
@@ -1209,10 +1209,6 @@ mesh_send_reply(struct mesh_state* m, int rcode, struct reply_info* rep,
        struct timeval end_time;
        struct timeval duration;
        int secure;
-
-       rcode = mesh_is_udp(r) && mesh_is_rpz_respip_tcponly_action(m)
-                       ? (rcode|BIT_TC) : rcode;
-
        /* Copy the client's EDNS for later restore, to make sure the edns
         * compare is with the correct edns options. */
        struct edns_data edns_bak = r->edns;
@@ -1222,6 +1218,11 @@ mesh_send_reply(struct mesh_state* m, int rcode, struct reply_info* rep,
         * null stops the mesh state remove and thus
         * reply_list modification and accounting */
        struct mesh_reply* rlist = m->reply_list;
+
+       /* RPZ: apply actions */
+       rcode = mesh_is_udp(r) && mesh_is_rpz_respip_tcponly_action(m)
+                       ? (rcode|BIT_TC) : rcode;
+
        /* examine security status */
        if(m->s.env->need_to_validate && (!(r->qflags&BIT_CD) ||
                m->s.env->cfg->ignore_cd) && rep &&