From owner-svn-src-all@FreeBSD.ORG Mon Sep 6 13:17:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FC8710656A3; Mon, 6 Sep 2010 13:17:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F23A8FC1C; Mon, 6 Sep 2010 13:17:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o86DH2GP049821; Mon, 6 Sep 2010 13:17:02 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o86DH2ue049818; Mon, 6 Sep 2010 13:17:02 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201009061317.o86DH2ue049818@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 6 Sep 2010 13:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212256 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2010 13:17:02 -0000 Author: glebius Date: Mon Sep 6 13:17:01 2010 New Revision: 212256 URL: http://svn.freebsd.org/changeset/base/212256 Log: in_delayed_cksum() requires host byte order. Reported by: Alexander Levin MFC after: 1 week Modified: head/sys/netinet/ipfw/ip_fw_nat.c Modified: head/sys/netinet/ipfw/ip_fw_nat.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_nat.c Mon Sep 6 12:55:07 2010 (r212255) +++ head/sys/netinet/ipfw/ip_fw_nat.c Mon Sep 6 13:17:01 2010 (r212256) @@ -295,12 +295,9 @@ ipfw_nat(struct ip_fw_args *args, struct struct udphdr *uh; u_short cksum; - /* XXX check if ip_len can stay in net format */ - cksum = in_pseudo( - ip->ip_src.s_addr, - ip->ip_dst.s_addr, - htons(ip->ip_p + ntohs(ip->ip_len) - (ip->ip_hl << 2)) - ); + ip->ip_len = ntohs(ip->ip_len); + cksum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, + htons(ip->ip_p + ip->ip_len - (ip->ip_hl << 2))); switch (ip->ip_p) { case IPPROTO_TCP: @@ -326,6 +323,7 @@ ipfw_nat(struct ip_fw_args *args, struct in_delayed_cksum(mcl); mcl->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } + ip->ip_len = htons(ip->ip_len); } args->m = mcl; return (IP_FW_NAT);