NetBSD Problem Report #53207
From www@NetBSD.org Mon Apr 23 12:47:57 2018
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id D05FC7A16B
for <gnats-bugs@gnats.NetBSD.org>; Mon, 23 Apr 2018 12:47:57 +0000 (UTC)
Message-Id: <20180423124756.D1D067A1F7@mollari.NetBSD.org>
Date: Mon, 23 Apr 2018 12:47:56 +0000 (UTC)
From: dcb314@hotmail.com
Reply-To: dcb314@hotmail.com
To: gnats-bugs@NetBSD.org
Subject: src/sys/net/npf/npf_nat.c:893: bad expression ?
X-Send-Pr-Version: www-1.0
>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: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Apr 23 12:50:00 +0000 2018
>Closed-Date: Tue Apr 24 15:41:28 +0000 2018
>Last-Modified: Sat May 05 19:20: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:
>Release-Note:
>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/53207 CVS commit: src/sys/net/npf
Date: Mon, 23 Apr 2018 11:36:30 -0400
Module Name: src
Committed By: christos
Date: Mon Apr 23 15:36:30 UTC 2018
Modified Files:
src/sys/net/npf: npf_nat.c
Log Message:
PR/53207: David Binderman: Use logical and
To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/net/npf/npf_nat.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: prlw1@NetBSD.org
State-Changed-When: Tue, 24 Apr 2018 15:41:28 +0000
State-Changed-Why:
Fixed by Christos
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/53207 CVS commit: [netbsd-8] src/sys/net/npf
Date: Sat, 5 May 2018 19:15:55 +0000
Module Name: src
Committed By: martin
Date: Sat May 5 19:15:55 UTC 2018
Modified Files:
src/sys/net/npf [netbsd-8]: npf_nat.c
Log Message:
Pull up following revision(s) (requested by prlw1 in ticket #795):
sys/net/npf/npf_nat.c: revision 1.42
PR/53207: David Binderman: Use logical and
To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.41.8.1 src/sys/net/npf/npf_nat.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.