Date: Mon, 30 Mar 2009 20:25:04 +0000 (UTC) From: Paolo Pisati <piso@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r190572 - in user/piso: . sys/netinet Message-ID: <200903302025.n2UKP4SC077367@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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__)); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903302025.n2UKP4SC077367>