From owner-freebsd-bugs@FreeBSD.ORG Fri Jul 30 16:40:07 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 643741065672 for ; Fri, 30 Jul 2010 16:40:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 297298FC13 for ; Fri, 30 Jul 2010 16:40:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o6UGe7fs059673 for ; Fri, 30 Jul 2010 16:40:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o6UGe7uh059672; Fri, 30 Jul 2010 16:40:07 GMT (envelope-from gnats) Resent-Date: Fri, 30 Jul 2010 16:40:07 GMT Resent-Message-Id: <201007301640.o6UGe7uh059672@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Thomas Quinot Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54495106566B for ; Fri, 30 Jul 2010 16:31:47 +0000 (UTC) (envelope-from thomas@cuivre.fr.eu.org) Received: from melamine.cuivre.fr.eu.org (unknown [IPv6:2001:470:1f15:1531:224:e8ff:fe3d:60a5]) by mx1.freebsd.org (Postfix) with ESMTP id 17DE48FC08 for ; Fri, 30 Jul 2010 16:31:47 +0000 (UTC) Received: by melamine.cuivre.fr.eu.org (Postfix, from userid 1000) id 6F323261C; Fri, 30 Jul 2010 18:31:46 +0200 (CEST) Message-Id: <20100730163146.6F323261C@melamine.cuivre.fr.eu.org> Date: Fri, 30 Jul 2010 18:31:46 +0200 (CEST) From: Thomas Quinot To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/149117: in_pcbbind: redundant test X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Thomas Quinot List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jul 2010 16:40:07 -0000 >Number: 149117 >Category: kern >Synopsis: in_pcbbind: redundant test >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jul 30 16:40:06 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Thomas Quinot >Release: FreeBSD 8.0-STABLE amd64 >Organization: >Environment: System: FreeBSD melamine.cuivre.fr.eu.org 8.0-STABLE FreeBSD 8.0-STABLE #0: Sun Mar 28 14:46:11 CEST 2010 thomas@melamine.cuivre.fr.eu.org:/usr/obj/usr/src/sys/GENERIC amd64 >Description: in_pcbbind has a redundant test for inp->inp_lport == 0: if this is not true, the if statement just above will have caused an early return with EINVAL. >How-To-Repeat: Found by code reading. No observable effect. >Fix: Index: in_pcb.c =================================================================== --- in_pcb.c (révision 210660) +++ in_pcb.c (copie de travail) @@ -296,8 +296,7 @@ if (inp->inp_lport != 0 || inp->inp_laddr.s_addr != INADDR_ANY) return (EINVAL); - anonport = inp->inp_lport == 0 && (nam == NULL || - ((struct sockaddr_in *)nam)->sin_port == 0); + anonport = nam == NULL || ((struct sockaddr_in *)nam)->sin_port == 0; error = in_pcbbind_setup(inp, nam, &inp->inp_laddr.s_addr, &inp->inp_lport, cred); if (error) >Release-Note: >Audit-Trail: >Unformatted: