diff options
author | thompsa <thompsa@FreeBSD.org> | 2005-07-02 23:13:31 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2005-07-02 23:13:31 +0000 |
commit | d7e928629d1fd82199b336e5a513e6308c7ec45b (patch) | |
tree | 89cd1b3b1b8fc11081f836fcc5b77a4e00d644f2 /sys/amd64 | |
parent | dd5c43b57252ea9dec17cd9c876da75544db45c4 (diff) | |
download | FreeBSD-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/amd64')
-rw-r--r-- | sys/amd64/include/_types.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/amd64/include/_types.h b/sys/amd64/include/_types.h index ab19b6c..4217c82 100644 --- a/sys/amd64/include/_types.h +++ b/sys/amd64/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. */ |