]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix bitwise operators in conditional expressions with parentheses.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 11 Jun 2025 13:46:31 +0000 (15:46 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 11 Jun 2025 13:46:31 +0000 (15:46 +0200)
dnstap/dtstream.c
doc/Changelog
util/mini_event.c
util/netevent.c

index 2d5ab20f0c84caf497cdf922fa0431a2b16dbba1..39d43403bc6232f852b0353df949b5502fe28ff9 100644 (file)
@@ -1509,7 +1509,7 @@ void dtio_output_cb(int ATTR_UNUSED(fd), short bits, void* arg)
        }
 #endif
 
-       if((bits&UB_EV_READ || dtio->ssl_brief_write)) {
+       if((bits&UB_EV_READ) || dtio->ssl_brief_write) {
 #ifdef HAVE_SSL
                if(dtio->ssl_brief_write)
                        (void)dtio_disable_brief_write(dtio);
index d865dbf41b5182379ca0d2f3ec2c867906a1d3bd..34c2fdcae4534a65e009ddb665b46c06b3f39947 100644 (file)
@@ -1,3 +1,6 @@
+11 June 2025: Wouter
+       - Fix bitwise operators in conditional expressions with parentheses.
+
 5 June 2025: Wouter
        - Fix unbound-anchor certificate file read for line ends and end of
          file.
index c05dc668c676ccde8a8a7cadf46c95d02263bd7c..2be42b2ccf0556ece3b5d1207d83adc0781424fa 100644 (file)
@@ -297,10 +297,10 @@ int event_add(struct event* ev, struct timeval* tv)
                return -1;
        if( (ev->ev_events&(EV_READ|EV_WRITE)) && ev->ev_fd != -1) {
                ev->ev_base->fds[ev->ev_fd] = ev;
-               if(ev->ev_events&EV_READ) {
+               if((ev->ev_events&EV_READ)) {
                        FD_SET(FD_SET_T ev->ev_fd, &ev->ev_base->reads);
                }
-               if(ev->ev_events&EV_WRITE) {
+               if((ev->ev_events&EV_WRITE)) {
                        FD_SET(FD_SET_T ev->ev_fd, &ev->ev_base->writes);
                }
                FD_SET(FD_SET_T ev->ev_fd, &ev->ev_base->content);
index 0d0fff429c038a83eafd0716868efb3e758f2bfb..898db57e93908b875fab936007a0b3eb395ef205 100644 (file)
@@ -4630,7 +4630,7 @@ comm_point_tcp_handle_callback(int fd, short event, void* arg)
        }
 #endif
 
-       if(event&UB_EV_TIMEOUT) {
+       if((event&UB_EV_TIMEOUT)) {
                verbose(VERB_QUERY, "tcp took too long, dropped");
                reclaim_tcp_handler(c);
                if(!c->tcp_do_close) {
@@ -4640,7 +4640,7 @@ comm_point_tcp_handle_callback(int fd, short event, void* arg)
                }
                return;
        }
-       if(event&UB_EV_READ
+       if((event&UB_EV_READ)
 #ifdef USE_MSG_FASTOPEN
                && !(c->tcp_do_fastopen && (event&UB_EV_WRITE))
 #endif
@@ -4665,7 +4665,7 @@ comm_point_tcp_handle_callback(int fd, short event, void* arg)
                        tcp_more_read_again(fd, c);
                return;
        }
-       if(event&UB_EV_WRITE) {
+       if((event&UB_EV_WRITE)) {
                int has_tcpq = (c->tcp_req_info != NULL);
                int* morewrite = c->tcp_more_write_again;
                if(!comm_point_tcp_handle_write(fd, c)) {
@@ -5648,7 +5648,7 @@ comm_point_http_handle_callback(int fd, short event, void* arg)
        log_assert(c->type == comm_http);
        ub_comm_base_now(c->ev->base);
 
-       if(event&UB_EV_TIMEOUT) {
+       if((event&UB_EV_TIMEOUT)) {
                verbose(VERB_QUERY, "http took too long, dropped");
                reclaim_http_handler(c);
                if(!c->tcp_do_close) {
@@ -5658,7 +5658,7 @@ comm_point_http_handle_callback(int fd, short event, void* arg)
                }
                return;
        }
-       if(event&UB_EV_READ) {
+       if((event&UB_EV_READ)) {
                if(!comm_point_http_handle_read(fd, c)) {
                        reclaim_http_handler(c);
                        if(!c->tcp_do_close) {
@@ -5670,7 +5670,7 @@ comm_point_http_handle_callback(int fd, short event, void* arg)
                }
                return;
        }
-       if(event&UB_EV_WRITE) {
+       if((event&UB_EV_WRITE)) {
                if(!comm_point_http_handle_write(fd, c)) {
                        reclaim_http_handler(c);
                        if(!c->tcp_do_close) {
@@ -5691,7 +5691,7 @@ void comm_point_local_handle_callback(int fd, short event, void* arg)
        log_assert(c->type == comm_local);
        ub_comm_base_now(c->ev->base);
 
-       if(event&UB_EV_READ) {
+       if((event&UB_EV_READ)) {
                if(!comm_point_tcp_handle_read(fd, c, 1)) {
                        fptr_ok(fptr_whitelist_comm_point(c->callback));
                        (void)(*c->callback)(c, c->cb_arg, NETEVENT_CLOSED,
@@ -5710,7 +5710,7 @@ void comm_point_raw_handle_callback(int ATTR_UNUSED(fd),
        log_assert(c->type == comm_raw);
        ub_comm_base_now(c->ev->base);
 
-       if(event&UB_EV_TIMEOUT)
+       if((event&UB_EV_TIMEOUT))
                err = NETEVENT_TIMEOUT;
        fptr_ok(fptr_whitelist_comm_point_raw(c->callback));
        (void)(*c->callback)(c, c->cb_arg, err, NULL);