From fffcbbcd946a672d54ebc1ae4a565be3506d37c9 Mon Sep 17 00:00:00 2001
From: Bill Fenner <fenner@FreeBSD.org>
Date: Wed, 25 Jul 2001 20:15:17 +0000
Subject: [PATCH] Unbreak ip_mroute_mod

---
 sys/modules/Makefile               |  3 +--
 sys/modules/ip_mroute_mod/Makefile | 15 +++++++++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 06fd00e6fb21..67c1449253fc 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -1,7 +1,5 @@
 # $FreeBSD$
 
-# XXX present but broken: ip_mroute_mod
-
 .if exists(${.CURDIR}/../crypto) && !defined(NOCRYPT)
 _random=	random
 .endif
@@ -36,6 +34,7 @@ SUBDIR=	3dfx \
 	if_tap \
 	if_tun \
 	ip6fw \
+	ip_mroute_mod \
 	ipfilter \
 	ipfw \
 	ispfw \
diff --git a/sys/modules/ip_mroute_mod/Makefile b/sys/modules/ip_mroute_mod/Makefile
index cbe04ab4520a..d1e2d16dc339 100644
--- a/sys/modules/ip_mroute_mod/Makefile
+++ b/sys/modules/ip_mroute_mod/Makefile
@@ -3,9 +3,20 @@
 .PATH: ${.CURDIR}/../../netinet
 
 KMOD=	ip_mroute
-SRCS=	ip_mroute.c
+SRCS=	ip_mroute.c opt_mrouting.h opt_random_ip_id.h
 NOMAN=
 
-CFLAGS+= -DMROUTE_LKM -DMROUTING
+CFLAGS+= -DMROUTE_KLD
+
+RANDOM_IP_ID?=	0	# 0/1 - should jibe with kernel configuration
+
+opt_mrouting.h:
+	echo "#define	MROUTING 1" > ${.TARGET}
+
+opt_random_ip_id.h:
+	touch ${.TARGET}
+.if ${RANDOM_IP_ID} > 0
+	echo "#define	RANDOM_IP_ID 1" > ${.TARGET}
+.endif
 
 .include <bsd.kmod.mk>