Found with clang. The warning was:
        clang -O2 -pipe  -Wall -Wmissing-prototypes -Wno-uninitialized 
-Wstrict-prototypes -I/usr/src/sbin/pfctl -Werror-implicit-function-declaration 
 -c parse.c                                                          
        /usr/src/sbin/pfctl/parse.y:4599:52: warning: comparison of array 
'np->port' not equal to a null pointer is always true                           
                                                                  
              [-Wtautological-pointer-compare]               
                        if (!rs->rdr->rport.b && rs->rdr->rport.t && np->port 
!= NULL) {                          
                                                                     ~~~~^~~~   
 ~~~~

"np" is: struct node_port *np
which is:
        struct node_port {
                u_int16_t                port[2];
                u_int8_t                 op;
                struct node_port        *next;
                struct node_port        *tail;
        };

Index: sbin/pfctl/parse.y
===================================================================
RCS file: /cvs/src/sbin/pfctl/parse.y,v
retrieving revision 1.659
diff -u -p -r1.659 parse.y
--- sbin/pfctl/parse.y  15 May 2017 11:23:25 -0000      1.659
+++ sbin/pfctl/parse.y  27 May 2017 17:46:24 -0000
@@ -4596,7 +4596,7 @@ apply_redirspec(struct pf_pool *rpool, s
        rpool->proxy_port[0] = ntohs(rs->rdr->rport.a);
 
        if (isrdr) {
-               if (!rs->rdr->rport.b && rs->rdr->rport.t && np->port != NULL) {
+               if (!rs->rdr->rport.b && rs->rdr->rport.t) {
                        rpool->proxy_port[1] = ntohs(rs->rdr->rport.a) +
                            (ntohs(np->port[1]) - ntohs(np->port[0]));
                } else

-- 
Michal Mazurek

Reply via email to