NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/53207: src/sys/net/npf/npf_nat.c:893: bad expression ?



>Number:         53207
>Category:       kern
>Synopsis:       src/sys/net/npf/npf_nat.c:893: bad expression ?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 23 12:50:00 +0000 2018
>Originator:     David Binderman
>Release:        cvs-20180418
>Organization:
>Environment:
>Description:
src/sys/net/npf/npf_nat.c:893]: (style) Boolean result is used in bitwise operation. Clarify expression with parentheses.


Source code is

         if ((np->n_flags & NPF_NAT_PORTMAP) != 0 && nt->nt_tport &
            !npf_nat_takeport(np, nt->nt_tport)) {

Maybe better code

        if ((np->n_flags & NPF_NAT_PORTMAP) != 0 && nt->nt_tport &&
            !npf_nat_takeport(np, nt->nt_tport)) {

  
>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index