summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/netinet/ip_fw2.c14
-rw-r--r--sys/netinet/ip_icmp.h11
-rw-r--r--sys/sys/param.h2
3 files changed, 17 insertions, 10 deletions
diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c
index 5d50ce5..c079970 100644
--- a/sys/netinet/ip_fw2.c
+++ b/sys/netinet/ip_fw2.c
@@ -328,11 +328,11 @@ SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, dyn_keepalive, CTLFLAG_RW,
#define L3HDR(T, ip) ((T *)((u_int32_t *)(ip) + (ip)->ip_hl))
#define TCP(p) ((struct tcphdr *)(p))
#define UDP(p) ((struct udphdr *)(p))
-#define ICMP(p) ((struct icmp *)(p))
+#define ICMP(p) ((struct icmphdr *)(p))
#define ICMP6(p) ((struct icmp6_hdr *)(p))
static __inline int
-icmptype_match(struct icmp *icmp, ipfw_insn_u32 *cmd)
+icmptype_match(struct icmphdr *icmp, ipfw_insn_u32 *cmd)
{
int type = icmp->icmp_type;
@@ -343,7 +343,7 @@ icmptype_match(struct icmp *icmp, ipfw_insn_u32 *cmd)
(1 << ICMP_TSTAMP) | (1 << ICMP_IREQ) | (1 << ICMP_MASKREQ) )
static int
-is_icmp_query(struct icmp *icmp)
+is_icmp_query(struct icmphdr *icmp)
{
int type = icmp->icmp_type;
@@ -760,7 +760,7 @@ ipfw_log(struct ip_fw *f, u_int hlen, struct ether_header *eh,
} else {
struct ip *ip = mtod(m, struct ip *);
/* these three are all aliases to the same thing */
- struct icmp *const icmp = L3HDR(struct icmp, ip);
+ struct icmphdr *const icmp = L3HDR(struct icmphdr, ip);
struct tcphdr *const tcp = (struct tcphdr *)icmp;
struct udphdr *const udp = (struct udphdr *)icmp;
@@ -2108,11 +2108,7 @@ do { \
break;
case IPPROTO_ICMP:
- /*
- * we only care for 4 bytes: type, code,
- * checksum
- */
- PULLUP_TO(hlen, ulp, struct icmp);
+ PULLUP_TO(hlen, ulp, struct icmphdr);
args->f_id.flags = ICMP(ulp)->icmp_type;
break;
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 */
diff --git a/sys/sys/param.h b/sys/sys/param.h
index d36a20b..be81180 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -57,7 +57,7 @@
* is created, otherwise 1.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 600024 /* Master, propagated to newvers */
+#define __FreeBSD_version 600025 /* Master, propagated to newvers */
#ifndef LOCORE
#include <sys/types.h>
OpenPOWER on IntegriCloud