summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/_types.h
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2005-07-02 23:13:31 +0000
committerthompsa <thompsa@FreeBSD.org>2005-07-02 23:13:31 +0000
commitd7e928629d1fd82199b336e5a513e6308c7ec45b (patch)
tree89cd1b3b1b8fc11081f836fcc5b77a4e00d644f2 /sys/i386/include/_types.h
parentdd5c43b57252ea9dec17cd9c876da75544db45c4 (diff)
downloadFreeBSD-src-d7e928629d1fd82199b336e5a513e6308c7ec45b.zip
FreeBSD-src-d7e928629d1fd82199b336e5a513e6308c7ec45b.tar.gz
Check the alignment of the IP header before passing the packet up to the
packet filter. This would cause a panic on architectures that require strict alignment such as sparc64 (tier1) and ia64/ppc (tier2). This adds two new macros that check the alignment, these are compile time dependent on __NO_STRICT_ALIGNMENT which is set for i386 and amd64 where alignment isn't need so the cost is avoided. IP_HDR_ALIGNED_P() IP6_HDR_ALIGNED_P() Move bridge_ip_checkbasic()/bridge_ip6_checkbasic() up so that the alignment is checked for ipfw and dummynet too. PR: ia64/81284 Obtained from: NetBSD Approved by: re (dwhite), mlaier (mentor)
Diffstat (limited to 'sys/i386/include/_types.h')
-rw-r--r--sys/i386/include/_types.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/i386/include/_types.h b/sys/i386/include/_types.h
index 7df734d..b272cf0 100644
--- a/sys/i386/include/_types.h
+++ b/sys/i386/include/_types.h
@@ -43,6 +43,8 @@
#error this file needs sys/cdefs.h as a prerequisite
#endif
+#define __NO_STRICT_ALIGNMENT
+
/*
* Basic types upon which most other types are built.
*/
OpenPOWER on IntegriCloud