PERFORCE change 38430 for review
Sam Leffler
sam at FreeBSD.org
Mon Sep 22 11:42:19 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=38430
Change 38430 by sam at sam_ebb on 2003/09/22 11:41:47
remove bogus work done in the wrapper function: unlike netbsd
we pass in an ip header with fields in host byte order; also don't
need to do delayed checksum on output, it's already been done in
ip_output
Pointed out by: "Max Laier" <max at love2party.net>
Affected files ...
.. //depot/projects/netperf/sys/contrib/ipfilter/netinet/ip_fil.c#3 edit
Differences ...
==== //depot/projects/netperf/sys/contrib/ipfilter/netinet/ip_fil.c#3 (text+ko) ====
@@ -314,41 +314,7 @@
fr_check_wrapper(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir)
{
struct ip *ip = mtod(*mp, struct ip *);
- int rv, hlen = ip->ip_hl << 2;
-
- /*
- * If the packet is out-bound, we can't delay checksums
- * here. For in-bound, the checksum has already been
- * validated.
- */
- if (dir == PFIL_OUT) {
- if ((*mp)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) {
- in_delayed_cksum(*mp);
- (*mp)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
- }
- }
-
- /*
- * We get the packet with all fields in network byte
- * order. We expect ip_len and ip_off to be in host
- * order. We frob them, call the filter, then frob
- * them back.
- *
- * Note, we don't need to update the checksum, because
- * it has already been verified.
- */
- ip->ip_len = ntohs(ip->ip_len);
- ip->ip_off = ntohs(ip->ip_off);
-
- rv = fr_check(ip, hlen, ifp, (dir == PFIL_OUT), mp);
-
- if (rv == 0 && *mp != NULL) {
- ip = mtod(*mp, struct ip *);
- ip->ip_len = ntohs(ip->ip_len);
- ip->ip_off = ntohs(ip->ip_off);
- }
-
- return (rv);
+ return fr_check(ip, ip->ip_hl << 2, ifp, (dir == PFIL_OUT), mp);
}
# ifdef USE_INET6
More information about the p4-projects
mailing list