From owner-svn-src-user@FreeBSD.ORG Sat Apr 11 14:24:29 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A835B106564A; Sat, 11 Apr 2009 14:24:29 +0000 (UTC) (envelope-from piso@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96E928FC12; Sat, 11 Apr 2009 14:24:29 +0000 (UTC) (envelope-from piso@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3BEOT3l088780; Sat, 11 Apr 2009 14:24:29 GMT (envelope-from piso@svn.freebsd.org) Received: (from piso@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BEOTIW088779; Sat, 11 Apr 2009 14:24:29 GMT (envelope-from piso@svn.freebsd.org) Message-Id: <200904111424.n3BEOTIW088779@svn.freebsd.org> From: Paolo Pisati Date: Sat, 11 Apr 2009 14:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190926 - user/piso/ipfw/sys/netinet/libalias X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 14:24:29 -0000 Author: piso Date: Sat Apr 11 14:24:29 2009 New Revision: 190926 URL: http://svn.freebsd.org/changeset/base/190926 Log: Anticipate a check: what's the point of adjusting a checksum if we are going to toss the packet anyway? Modified: user/piso/ipfw/sys/netinet/libalias/alias.c Modified: user/piso/ipfw/sys/netinet/libalias/alias.c ============================================================================== --- user/piso/ipfw/sys/netinet/libalias/alias.c Sat Apr 11 14:20:45 2009 (r190925) +++ user/piso/ipfw/sys/netinet/libalias/alias.c Sat Apr 11 14:24:29 2009 (r190926) @@ -762,6 +762,9 @@ UdpAliasIn(struct libalias *la, struct i /* Walk out chain. */ error = find_handler(IN, UDP, la, pip, &ad); + /* If we cannot figure out the packet, ignore it. */ + if (error < 0) + return (PKT_ALIAS_IGNORED); /* If UDP checksum is not zero, then adjust since destination port */ /* is being unaliased and destination address is being altered. */ @@ -801,13 +804,7 @@ UdpAliasIn(struct libalias *la, struct i &original_address, &pip->ip_dst, 2); pip->ip_dst = original_address; - /* - * If we cannot figure out the packet, ignore it. - */ - if (error < 0) - return (PKT_ALIAS_IGNORED); - else - return (PKT_ALIAS_OK); + return (PKT_ALIAS_OK); } return (PKT_ALIAS_IGNORED); }