From e6a63dafc50ee44b4191bf57efc38f908cb7575a Mon Sep 17 00:00:00 2001 From: itojun <> Date: Sun, 2 Jan 2000 14:25:07 +0000 Subject: [PATCH] add following IPv6 configs: rtadvd_flags route6d_flags rtsold_flags --- src/etc/rc | 28 +++++++++++++++++++++++++++- src/etc/rc.conf | 9 ++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/etc/rc b/src/etc/rc index cf5c19f0..daa90e20 100644 --- a/src/etc/rc +++ b/src/etc/rc @@ -1,4 +1,4 @@ -# $OpenBSD: rc,v 1.126 2000/01/01 22:45:35 deraadt Exp $ +# $OpenBSD: rc,v 1.127 2000/01/02 14:25:07 itojun Exp $ # System startup script run by init on autoboot # or after single-user. @@ -384,6 +384,32 @@ if [ "X${dhcpd_flags}" != X"NO" -a -f /etc/dhcpd.conf ]; then echo -n ' dhcpd'; /usr/sbin/dhcpd ${dhcpd_flags} ${dhcpd_ifs} fi +if ifconfig lo0 inet6 >/dev/null 2>&1; then + fw=`sysctl -n net.inet6.ip6.forwarding` + if [ "X${fw}" == X"0" ]; then + # $rtsold_flags is imported from /etc/rc.conf; + # If $rtsold_flags == NO, then rtsold isn't run. + if [ "X${rtsold_flags}" != X"NO" ]; then + echo -n ' rtsold' + /usr/sbin/rtsold ${rtsold_flags} + fi + else + # $route6d_flags is imported from /etc/rc.conf; + # If $route6d_flags == NO, then route6d isn't run. + if [ "X${route6d_flags}" != X"NO" ]; then + echo -n ' route6d' + /usr/sbin/route6d ${route6d_flags} + fi + # $rtadvd_flags is imported from /etc/rc.conf; + # If $rtadvd_flags == NO or /etc/rtadvd.conf doesn't exist, + # then rtadvd isn't run. + if [ "X${rtadvd_flags}" != X"NO" -a -f /etc/rtadvd.conf ]; then + echo -n ' rtadvd' + /usr/sbin/rtadvd ${rtadvd_flags} + fi + fi +fi + # $rwhod is imported from /etc/rc.conf; # if $rwhod == YES, rwhod is run. if [ X${rwhod} = X"YES" ]; then diff --git a/src/etc/rc.conf b/src/etc/rc.conf index efb4e9c6..efbb8034 100644 --- a/src/etc/rc.conf +++ b/src/etc/rc.conf @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: rc.conf,v 1.41 1999/11/11 22:28:43 fgsch Exp $ +# $OpenBSD: rc.conf,v 1.42 2000/01/02 14:25:07 itojun Exp $ # set these to "NO" to turn them off. otherwise, they're used as flags routed_flags=NO # for normal use: "-q" @@ -19,6 +19,13 @@ mopd_flags=NO # for normal use: "-a" httpd_flags=NO # for normal use: "" (or "-DSSL" after reading ssl(8)) apmd_flags=NO # for normal use: "" dhcpd_flags=NO # for normal use: "-q" +rtadvd_flags=NO # for normal use: list of interfaces + # be sure to set net.inet6.ip6.forwarding=1 +route6d_flags=NO # for normal use: "" + # be sure to set net.inet6.ip6.forwarding=1 +rtsold_flags=NO # for normal use: interface + # be sure to set net.inet6.ip6.forwarding=0 + # be sure to set net.inet6.ip6.accept_rtadv=1 # Set to NO if ftpd is running out of inetd ftpd_flags=NO # for non-inetd use: "-D"