summaryrefslogtreecommitdiffstats
path: root/sys/modules
diff options
context:
space:
mode:
authorwill <will@FreeBSD.org>2010-08-11 00:51:50 +0000
committerwill <will@FreeBSD.org>2010-08-11 00:51:50 +0000
commitaa4e762c4a720fc3e1b4d3f08d09c5b65bb07735 (patch)
tree5194d90f80d5d4fac28f6f736d5c02cf80511112 /sys/modules
parent8afd703de9fc0419708d83e8c31c1f0facca78dd (diff)
downloadFreeBSD-src-aa4e762c4a720fc3e1b4d3f08d09c5b65bb07735.zip
FreeBSD-src-aa4e762c4a720fc3e1b4d3f08d09c5b65bb07735.tar.gz
Allow carp(4) to be loaded as a kernel module. Follow precedent set by
bridge(4), lagg(4) etc. and make use of function pointers and pf_proto_register() to hook carp into the network stack. Currently, because of the uncertainty about whether the unload path is free of race condition panics, unloads are disallowed by default. Compiling with CARPMOD_CAN_UNLOAD in CFLAGS removes this anti foot shooting measure. This commit requires IP6PROTOSPACER, introduced in r211115. Reviewed by: bz, simon Approved by: ken (mentor) MFC after: 2 weeks
Diffstat (limited to 'sys/modules')
-rw-r--r--sys/modules/Makefile1
-rw-r--r--sys/modules/if_carp/Makefile21
2 files changed, 22 insertions, 0 deletions
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index d033a34..028c4cc 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -112,6 +112,7 @@ SUBDIR= ${_3dfx} \
${_ida} \
${_ie} \
if_bridge \
+ if_carp \
if_disc \
if_edsc \
if_ef \
diff --git a/sys/modules/if_carp/Makefile b/sys/modules/if_carp/Makefile
new file mode 100644
index 0000000..f315a80
--- /dev/null
+++ b/sys/modules/if_carp/Makefile
@@ -0,0 +1,21 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../netinet
+
+.include <bsd.own.mk>
+
+KMOD= if_carp
+SRCS= ip_carp.c
+SRCS+= opt_carp.h opt_bpf.h opt_inet.h opt_inet6.h vnode_if.h
+
+.if !defined(KERNBUILDDIR)
+opt_inet.h:
+ @echo "#define INET 1" > ${.TARGET}
+
+.if ${MK_INET6_SUPPORT} != "no"
+opt_inet6.h:
+ @echo "#define INET6 1" > ${.TARGET}
+.endif
+.endif
+
+.include <bsd.kmod.mk>
OpenPOWER on IntegriCloud