Bug 26543 - gifconfig in rc.conf ignored if ipv6_enable off
Summary: gifconfig in rc.conf ignored if ipv6_enable off
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Brian Somers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-04-13 21:40 UTC by Steve Watt
Modified: 2001-06-04 07:48 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Watt 2001-04-13 21:40:01 UTC
Trying to do IPsec without IPv6 set up.  I added the following to
/etc/rc.conf (IP addresses beaten up):

} ipsec_enable="YES"
} gif_interfaces="gif0"
} gifconfig_gif0="123.102.201.6 205.15.252.155"
} ifconfig_gif0="inet 172.30.166.128 netmask 255.255.255.192 192.168.1.1 netmask 255.255.255.0"

ipv6_enable is *NOT* set in rc.conf; I don't really want to fiddle
with that stuff yet.

On bootup, the gifconfig stuff only happens (in rc.network6) if
ipv6_enable is on.  However, gif interfaces are useful in more places
than just ipv6.

Fix: 

Move the gifconfig out of rc.network6 into rc.network in some appropriate
place.
How-To-Repeat: Add a gif_interfaces list to rc.conf, observe that gifconfig doesn't get
run during startup.
Comment 1 brooks 2001-06-02 02:52:20 UTC
I've attached a patch to the end of this message the moves gifconfig to
/etc/rc.network from /etc/rc.network6.  When applied you may see a small
note with regard to /etc/defaults/rc.conf due to the fact that I deleted
to unrelated changes from that diff.

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4

Index: rc.network
===================================================================
RCS file: /home/ncvs/src/etc/rc.network,v
retrieving revision 1.95
diff -u -r1.95 rc.network
--- rc.network	2001/05/18 18:10:02	1.95
+++ rc.network	2001/06/02 01:21:19
@@ -129,6 +129,9 @@
 		fi
 	done
 
+	# gifconfig
+	network_gif_setup
+
 	# Set up all the network interfaces, calling startup scripts if needed
 	#
 	case ${network_interfaces} in
@@ -767,3 +770,23 @@
         }' < $host_conf > $nsswitch_conf
 }
 
+network_gif_setup() {
+	case ${gif_interfaces} in
+	[Nn][Oo] | '')
+		;;
+	*)
+		for i in ${gif_interfaces}; do
+			eval peers=\$gifconfig_$i
+			case ${peers} in
+			'')
+				continue
+				;;
+			*)
+				gifconfig $i ${peers}
+				;;
+			esac
+		done
+		;;
+	esac
+}
+}
Index: rc.network6
===================================================================
RCS file: /home/ncvs/src/etc/rc.network6,v
retrieving revision 1.18
diff -u -r1.18 rc.network6
--- rc.network6	2001/04/26 17:33:37	1.18
+++ rc.network6	2001/06/02 01:21:34
@@ -125,9 +125,6 @@
 		;;
 	esac
 
-	# gifconfig
-	network6_gif_setup
-
 	# setting up interfaces
 	network6_interface_setup $ipv6_network_interfaces
 
@@ -337,26 +334,6 @@
 		ifconfig $1 up
 		rtsol $1
 	fi
-}
-
-network6_gif_setup() {
-	case ${gif_interfaces} in
-	[Nn][Oo] | '')
-		;;
-	*)
-		for i in ${gif_interfaces}; do
-			eval peers=\$gifconfig_$i
-			case ${peers} in
-			'')
-				continue
-				;;
-			*)
-				gifconfig $i ${peers}
-				;;
-			esac
-		done
-		;;
-	esac
 }
 
 network6_stf_setup() {
Index: defaults/rc.conf
===================================================================
RCS file: /home/ncvs/src/etc/defaults/rc.conf,v
retrieving revision 1.108
diff -u -r1.108 rc.conf
--- defaults/rc.conf	2001/05/25 01:46:39	1.108
+++ defaults/rc.conf	2001/06/02 01:12:40
@@ -93,6 +95,11 @@
 sppp_interfaces=""		# List of sppp interfaces.
 #sppp_interfaces="isp0"		# example: sppp over ISDN
 #spppconfig_isp0="authproto=chap myauthname=foo myauthsecret='top secret' hisauthname=some-gw hisauthsecret='another secret'"
+gif_interfaces="NO"		# List of GIF tunnels (or "NO").
+#gif_interfaces="gif0 gif1"	# Examples typically for a router.
+				# Choose correct tunnel addrs.
+#gifconfig_gif0="10.1.1.1 10.1.2.1"	# Examples typically for a router.
+#gifconfig_gif1="10.1.1.2 10.1.2.2"	# Examples typically for a router.
 
 # User ppp configuration.
 ppp_enable="NO"		# Start user-ppp (or NO).
@@ -252,11 +259,6 @@
 mroute6d_program="/usr/sbin/pim6dd"	# Name of IPv6 multicast routing
 					# daemon.
 mroute6d_flags=""		# Flags to IPv6 multicast routing daemon.
-gif_interfaces="NO"		# List of GIF tunnels (or "NO").
-#gif_interfaces="gif0 gif1"	# Examples typically for a router.
-				# Choose correct tunnel addrs.
-#gifconfig_gif0="10.1.1.1 10.1.2.1"	# Examples typically for a router.
-#gifconfig_gif1="10.1.1.2 10.1.2.2"	# Examples typically for a router.
 stf_interface_ipv4addr=""	# Local IPv4 addr for 6to4 IPv6 over IPv4
 				# tunneling interface. Specify this entry
 				# to enable 6to4 interface.
Comment 2 Brian Somers freebsd_committer freebsd_triage 2001-06-03 12:57:53 UTC
Responsible Changed
From-To: freebsd-bugs->brian

I'll apply this
Comment 3 Brian Somers freebsd_committer freebsd_triage 2001-06-04 07:47:42 UTC
State Changed
From-To: open->closed

Applied to -current.  I'll MFC in 3 weeks.