summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_icmp.h
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2005-04-26 18:10:21 +0000
committerbrooks <brooks@FreeBSD.org>2005-04-26 18:10:21 +0000
commit4d3f396bf60f7c76e101de098d6474eeb33fe976 (patch)
tree4e5871997c5feabf14fcd71b68406dc649fa6fb0 /sys/netinet/ip_icmp.h
parent6d6f9267f1415c07097fc5f4b8cc9bd1bfaefc60 (diff)
downloadFreeBSD-src-4d3f396bf60f7c76e101de098d6474eeb33fe976.zip
FreeBSD-src-4d3f396bf60f7c76e101de098d6474eeb33fe976.tar.gz
Introduce a struct icmphdr which contains the type, code, and cksum
fields of an ICMP packet. Use this to allow ipfw to pullup only these values since it does not use the rest of the packet and it was failed on ICMP packets because they were not long enough. struct icmp should probably be modified to use these at some point, but that will break a fair bit of code so it can wait for another day. On the off chance that adding this struct breaks something in ports, bump __FreeBSD_version. Reported by: Randy Bush <randy at psg dot com> Tested by: Randy Bush <randy at psg dot com>
Diffstat (limited to 'sys/netinet/ip_icmp.h')
-rw-r--r--sys/netinet/ip_icmp.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/netinet/ip_icmp.h b/sys/netinet/ip_icmp.h
index 6acff63..020dd96 100644
--- a/sys/netinet/ip_icmp.h
+++ b/sys/netinet/ip_icmp.h
@@ -49,6 +49,17 @@ struct icmp_ra_addr {
/*
* Structure of an icmp header.
*/
+struct icmphdr {
+ u_char icmp_type; /* type of message, see below */
+ u_char icmp_code; /* type sub code */
+ u_short icmp_cksum; /* ones complement cksum of struct */
+};
+
+/*
+ * Structure of an icmp packet.
+ *
+ * XXX: should start with a struct icmphdr.
+ */
struct icmp {
u_char icmp_type; /* type of message, see below */
u_char icmp_code; /* type sub code */
OpenPOWER on IntegriCloud