summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2004-02-26 03:53:54 +0000
committermlaier <mlaier@FreeBSD.org>2004-02-26 03:53:54 +0000
commit428f1c9a0fbaac94f9cce57cd846b2b6f82e17d1 (patch)
treeaa20382749ac1e97a0e00869aaa3a69abbc95a34 /sys/netinet
parent94f1c2c12e72d156571a8216199086ba2d775312 (diff)
downloadFreeBSD-src-428f1c9a0fbaac94f9cce57cd846b2b6f82e17d1.zip
FreeBSD-src-428f1c9a0fbaac94f9cce57cd846b2b6f82e17d1.tar.gz
Tweak existing header and other build infrastructure to be able to build
pf/pflog/pfsync as modules. Do not list them in NOTES or modules/Makefile (i.e. do not connect it to any (automatic) builds - yet). Approved by: bms(mentor)
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/icmp_var.h1
-rw-r--r--sys/netinet/ip_icmp.c13
-rw-r--r--sys/netinet/ip_icmp.h17
-rw-r--r--sys/netinet/ip_id.c5
4 files changed, 32 insertions, 4 deletions
diff --git a/sys/netinet/icmp_var.h b/sys/netinet/icmp_var.h
index 92e23c4..be47039 100644
--- a/sys/netinet/icmp_var.h
+++ b/sys/netinet/icmp_var.h
@@ -78,6 +78,7 @@ struct icmpstat {
#ifdef _KERNEL
SYSCTL_DECL(_net_inet_icmp);
+extern struct icmpstat icmpstat; /* icmp statistics */
extern int badport_bandlim(int);
#define BANDLIM_UNLIMITED -1
#define BANDLIM_ICMP_UNREACH 0
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index a157dd5..ee4792c 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -82,7 +82,7 @@
* host table maintenance routines.
*/
-static struct icmpstat icmpstat;
+struct icmpstat icmpstat;
SYSCTL_STRUCT(_net_inet_icmp, ICMPCTL_STATS, stats, CTLFLAG_RW,
&icmpstat, icmpstat, "");
@@ -148,6 +148,7 @@ icmp_error(n, type, code, dest, destifp)
register unsigned oiplen = oip->ip_hl << 2;
register struct icmp *icp;
register struct mbuf *m;
+ register struct m_tag *mtag;
unsigned icmplen;
#ifdef ICMPPRINTFS
@@ -235,6 +236,16 @@ icmp_error(n, type, code, dest, destifp)
nip->ip_hl = 5;
nip->ip_p = IPPROTO_ICMP;
nip->ip_tos = 0;
+ /*
+ * XXX: Move PF_GENERATED m_tag to new packet, if it exists.
+ * This should be replaced by unified flags/tags for
+ * pf/ipfw/ipf and future pfil_hook applications.
+ */
+ mtag = m_tag_find(n, PACKET_TAG_PF_GENERATED, NULL);
+ if (mtag != NULL) {
+ m_tag_unlink(n, mtag);
+ m_tag_prepend(m, mtag);
+ }
icmp_reflect(m);
freeit:
diff --git a/sys/netinet/ip_icmp.h b/sys/netinet/ip_icmp.h
index ba86502..c379324 100644
--- a/sys/netinet/ip_icmp.h
+++ b/sys/netinet/ip_icmp.h
@@ -153,8 +153,11 @@ struct icmp {
#define ICMP_REDIRECT_HOST 1 /* for host */
#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */
#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */
+#define ICMP_ALTHOSTADDR 6 /* alternate host address */
#define ICMP_ECHO 8 /* echo service */
#define ICMP_ROUTERADVERT 9 /* router advertisement */
+#define ICMP_ROUTERADVERT_NORMAL 0 /* normal advertisement */
+#define ICMP_ROUTERADVERT_NOROUTE_COMMON 16 /* selective routing */
#define ICMP_ROUTERSOLICIT 10 /* router solicitation */
#define ICMP_TIMXCEED 11 /* time exceeded, code: */
#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
@@ -169,8 +172,20 @@ struct icmp {
#define ICMP_IREQREPLY 16 /* information reply */
#define ICMP_MASKREQ 17 /* address mask request */
#define ICMP_MASKREPLY 18 /* address mask reply */
+#define ICMP_TRACEROUTE 30 /* traceroute */
+#define ICMP_DATACONVERR 31 /* data conversion error */
+#define ICMP_MOBILE_REDIRECT 32 /* mobile host redirect */
+#define ICMP_IPV6_WHEREAREYOU 33 /* IPv6 where-are-you */
+#define ICMP_IPV6_IAMHERE 34 /* IPv6 i-am-here */
+#define ICMP_MOBILE_REGREQUEST 35 /* mobile registration req */
+#define ICMP_MOBILE_REGREPLY 36 /* mobile registration reply */
+#define ICMP_SKIP 39 /* SKIP */
+#define ICMP_PHOTURIS 40 /* Photuris */
+#define ICMP_PHOTURIS_UNKNOWN_INDEX 1 /* unknown sec index */
+#define ICMP_PHOTURIS_AUTH_FAILED 2 /* auth failed */
+#define ICMP_PHOTURIS_DECRYPT_FAILED 3 /* decrypt failed */
-#define ICMP_MAXTYPE 18
+#define ICMP_MAXTYPE 40
#define ICMP_INFOTYPE(type) \
((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
diff --git a/sys/netinet/ip_id.c b/sys/netinet/ip_id.c
index d8be42b..700f731 100644
--- a/sys/netinet/ip_id.c
+++ b/sys/netinet/ip_id.c
@@ -58,12 +58,13 @@
*/
#include "opt_random_ip_id.h"
+#include "opt_pf.h"
#include <sys/param.h>
#include <sys/time.h>
#include <sys/kernel.h>
#include <sys/random.h>
-#ifdef RANDOM_IP_ID
+#if defined(RANDOM_IP_ID) || defined(DEV_PF)
#define RU_OUT 180 /* Time after wich will be reseeded */
#define RU_MAX 30000 /* Uniq cycle, avoid blackjack prediction */
#define RU_GEN 2 /* Starting generator */
@@ -208,4 +209,4 @@ ip_randomid(void)
return (ru_seed ^ pmod(ru_g,ru_seed2 ^ ru_x,RU_N)) | ru_msb;
}
-#endif /* RANDOM_IP_ID */
+#endif /* RANDOM_IP_ID || DEV_PF */
OpenPOWER on IntegriCloud