From owner-svn-src-user@FreeBSD.ORG Mon Mar 30 20:25:05 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 31F2A1065672; Mon, 30 Mar 2009 20:25:05 +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 066068FC26; Mon, 30 Mar 2009 20:25:05 +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 n2UKP4kU077370; Mon, 30 Mar 2009 20:25:04 GMT (envelope-from piso@svn.freebsd.org) Received: (from piso@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2UKP4SC077367; Mon, 30 Mar 2009 20:25:04 GMT (envelope-from piso@svn.freebsd.org) Message-Id: <200903302025.n2UKP4SC077367@svn.freebsd.org> From: Paolo Pisati Date: Mon, 30 Mar 2009 20:25:04 +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: r190572 - in user/piso: . sys/netinet 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: Mon, 30 Mar 2009 20:25:05 -0000 Author: piso Date: Mon Mar 30 20:25:04 2009 New Revision: 190572 URL: http://svn.freebsd.org/changeset/base/190572 Log: ip_reass() modify the mbuf, thus exit & reenter ipfw_chk() via IP_FW_REASS Modified: user/piso/ (props changed) user/piso/sys/netinet/ip_fw.h user/piso/sys/netinet/ip_fw2.c user/piso/sys/netinet/ip_fw_pfil.c Modified: user/piso/sys/netinet/ip_fw.h ============================================================================== --- user/piso/sys/netinet/ip_fw.h Mon Mar 30 19:23:49 2009 (r190571) +++ user/piso/sys/netinet/ip_fw.h Mon Mar 30 20:25:04 2009 (r190572) @@ -575,6 +575,7 @@ enum { IP_FW_NETGRAPH, IP_FW_NGTEE, IP_FW_NAT, + IP_FW_REASS, }; /* flags for divert mtag */ Modified: user/piso/sys/netinet/ip_fw2.c ============================================================================== --- user/piso/sys/netinet/ip_fw2.c Mon Mar 30 19:23:49 2009 (r190571) +++ user/piso/sys/netinet/ip_fw2.c Mon Mar 30 20:25:04 2009 (r190572) @@ -3407,23 +3407,20 @@ check_body: if (reass != NULL) { int hlen; - m = reass; - ip = mtod(m, struct ip *); + args->m = reass; + ip = mtod(args->m, struct ip *); hlen = ip->ip_hl << 2; /* revert len & off for layer2 pkts */ - if (args->eh != NULL) { + if (args->eh != NULL) ip->ip_len = htons(ip->ip_len); - /* XXX ip_off == 0 ?!?!? */ - ip->ip_off = htons(ip->ip_off); - } ip->ip_sum = 0; if (hlen == sizeof(struct ip)) ip->ip_sum = in_cksum_hdr(ip); else - ip->ip_sum = in_cksum(m, hlen); - IPFW_RUNLOCK(chain); - /* XXX race */ - goto reinit; + ip->ip_sum = in_cksum(args->m, hlen); + retval = IP_FW_REASS; + args->rule = f; + goto done; } else { /* XXX mbuf double free? */ retval = IP_FW_DENY; Modified: user/piso/sys/netinet/ip_fw_pfil.c ============================================================================== --- user/piso/sys/netinet/ip_fw_pfil.c Mon Mar 30 19:23:49 2009 (r190571) +++ user/piso/sys/netinet/ip_fw_pfil.c Mon Mar 30 20:25:04 2009 (r190572) @@ -200,6 +200,9 @@ again: case IP_FW_NAT: goto again; /* continue with packet */ + case IP_FW_REASS: + goto again; + default: KASSERT(0, ("%s: unknown retval", __func__)); } @@ -329,6 +332,9 @@ again: case IP_FW_NAT: goto again; /* continue with packet */ + case IP_FW_REASS: + goto again; + default: KASSERT(0, ("%s: unknown retval", __func__)); }