svn commit: r190572 - in user/piso: . sys/netinet
Paolo Pisati
piso at FreeBSD.org
Mon Mar 30 13:25:05 PDT 2009
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__));
}
More information about the svn-src-user
mailing list