From ba3ed2268c6d4dc7a3825318707360908d0ce2f0 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Tue, 16 May 2000 06:52:11 +0000 Subject: [PATCH] Add ipsec_enable and ipsec_file options to run IPSEC's setkey program with the specified configuration file at the appropriate time. --- etc/defaults/rc.conf | 2 ++ etc/network.subr | 11 +++++++++++ etc/rc.d/netoptions | 11 +++++++++++ etc/rc.d/network1 | 11 +++++++++++ etc/rc.d/network2 | 11 +++++++++++ etc/rc.d/network3 | 11 +++++++++++ etc/rc.d/routing | 11 +++++++++++ etc/rc.network | 11 +++++++++++ 8 files changed, 79 insertions(+) diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index f45269609e90..b11d6572dbbb 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -156,6 +156,8 @@ nis_yppasswdd_flags="" # Flags to rpc.yppasswdd (if enabled). defaultrouter="NO" # Set to default gateway (or NO). static_routes="" # Set to static route list (or leave empty). gateway_enable="NO" # Set to YES if this host will be a gateway. +ipsec_enable="NO" # Set to YES to run setkey on ipsec_file +ipsec_file="/etc/ipsec.conf" # Name of config file for setkey router_enable="NO" # Set to YES to enable a routing daemon. router="routed" # Name of routing daemon to use if enabled. router_flags="-q" # Flags for routing daemon. diff --git a/etc/network.subr b/etc/network.subr index e37d25f5746c..fc7cdd07c014 100644 --- a/etc/network.subr +++ b/etc/network.subr @@ -352,6 +352,17 @@ network_pass1() { esac echo '.' + case ${ipsec_enable} in + [Yy][Ee][Ss]) + if [ -f ${ipsec_file} ]; then + echo ' ipsec: enabled' + setkey -f ${ipsec_file} + else + echo ' ipsec: file not found' + fi + ;; + esac + echo -n 'routing daemons:' case ${router_enable} in [Yy][Ee][Ss]) diff --git a/etc/rc.d/netoptions b/etc/rc.d/netoptions index e37d25f5746c..fc7cdd07c014 100644 --- a/etc/rc.d/netoptions +++ b/etc/rc.d/netoptions @@ -352,6 +352,17 @@ network_pass1() { esac echo '.' + case ${ipsec_enable} in + [Yy][Ee][Ss]) + if [ -f ${ipsec_file} ]; then + echo ' ipsec: enabled' + setkey -f ${ipsec_file} + else + echo ' ipsec: file not found' + fi + ;; + esac + echo -n 'routing daemons:' case ${router_enable} in [Yy][Ee][Ss]) diff --git a/etc/rc.d/network1 b/etc/rc.d/network1 index e37d25f5746c..fc7cdd07c014 100644 --- a/etc/rc.d/network1 +++ b/etc/rc.d/network1 @@ -352,6 +352,17 @@ network_pass1() { esac echo '.' + case ${ipsec_enable} in + [Yy][Ee][Ss]) + if [ -f ${ipsec_file} ]; then + echo ' ipsec: enabled' + setkey -f ${ipsec_file} + else + echo ' ipsec: file not found' + fi + ;; + esac + echo -n 'routing daemons:' case ${router_enable} in [Yy][Ee][Ss]) diff --git a/etc/rc.d/network2 b/etc/rc.d/network2 index e37d25f5746c..fc7cdd07c014 100644 --- a/etc/rc.d/network2 +++ b/etc/rc.d/network2 @@ -352,6 +352,17 @@ network_pass1() { esac echo '.' + case ${ipsec_enable} in + [Yy][Ee][Ss]) + if [ -f ${ipsec_file} ]; then + echo ' ipsec: enabled' + setkey -f ${ipsec_file} + else + echo ' ipsec: file not found' + fi + ;; + esac + echo -n 'routing daemons:' case ${router_enable} in [Yy][Ee][Ss]) diff --git a/etc/rc.d/network3 b/etc/rc.d/network3 index e37d25f5746c..fc7cdd07c014 100644 --- a/etc/rc.d/network3 +++ b/etc/rc.d/network3 @@ -352,6 +352,17 @@ network_pass1() { esac echo '.' + case ${ipsec_enable} in + [Yy][Ee][Ss]) + if [ -f ${ipsec_file} ]; then + echo ' ipsec: enabled' + setkey -f ${ipsec_file} + else + echo ' ipsec: file not found' + fi + ;; + esac + echo -n 'routing daemons:' case ${router_enable} in [Yy][Ee][Ss]) diff --git a/etc/rc.d/routing b/etc/rc.d/routing index e37d25f5746c..fc7cdd07c014 100644 --- a/etc/rc.d/routing +++ b/etc/rc.d/routing @@ -352,6 +352,17 @@ network_pass1() { esac echo '.' + case ${ipsec_enable} in + [Yy][Ee][Ss]) + if [ -f ${ipsec_file} ]; then + echo ' ipsec: enabled' + setkey -f ${ipsec_file} + else + echo ' ipsec: file not found' + fi + ;; + esac + echo -n 'routing daemons:' case ${router_enable} in [Yy][Ee][Ss]) diff --git a/etc/rc.network b/etc/rc.network index e37d25f5746c..fc7cdd07c014 100644 --- a/etc/rc.network +++ b/etc/rc.network @@ -352,6 +352,17 @@ network_pass1() { esac echo '.' + case ${ipsec_enable} in + [Yy][Ee][Ss]) + if [ -f ${ipsec_file} ]; then + echo ' ipsec: enabled' + setkey -f ${ipsec_file} + else + echo ' ipsec: file not found' + fi + ;; + esac + echo -n 'routing daemons:' case ${router_enable} in [Yy][Ee][Ss])