Date: Wed, 22 Jan 2003 07:42:10 +0100 (CET) From: Christian Ullrich <chris+freebsd@chrullrich.de> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/47350: rc.network supports only one ppp profile Message-ID: <20030122064210.02B7349@ser1.chrullrich.de>
index | next in thread | raw e-mail
>Number: 47350
>Category: bin
>Synopsis: rc.network supports only one ppp profile
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Tue Jan 21 22:50:01 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: Christian Ullrich
>Release: FreeBSD 4.7-STABLE i386
>Organization:
>Environment:
System: FreeBSD ser1.chrullrich.de 4.7-STABLE FreeBSD 4.7-STABLE #1: Sat Oct 26 14:04:33 CEST 2002 toor@ser1.chrullrich.de:/usr/obj/usr/src/sys/SER1 i386
>Description:
rc.network supports starting only one ppp instance. If
any additional instances are required, they must be started
manually or from rc.d . This patch fixes this.
It introduces a new rc.conf variable ppp_profiles, which
defaults to $ppp_profile to keep backwards compatibility,
and uses variables which follow the pattern
ppp_${profile}_mode (profile-specific $ppp_mode, defaults to
$ppp_mode) and ppp_${profile}_args (supports additional
command-line arguments such as -unitX, defaults to empty).
The patch applies cleanly against -STABLE as of five minutes ago.
>How-To-Repeat:
>Fix:
--- multippp.diff begins here ---
--- etc/rc.network.orig Sun Nov 10 22:02:39 2002
+++ etc/rc.network Wed Jan 22 07:27:02 2003
@@ -266,28 +266,45 @@
#
case ${ppp_enable} in
[Yy][Ee][Ss])
- # Establish ppp mode.
- #
- if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \
- -a "${ppp_mode}" != "dedicated" \
- -a "${ppp_mode}" != "background" ]; then
- ppp_mode="auto"
+ # Backward compatibility (defaults/rc.conf uses this, too).
+ if [ -z "${ppp_profiles}" -a -n "${ppp_profile}" ]; then
+ ppp_profiles=$ppp_profile
fi
- ppp_command="/usr/sbin/ppp -quiet -${ppp_mode}"
+ # Start all profiles.
+ for i in ${ppp_profiles}; do
+ eval pppmode=\$ppp_${i}_mode
+ eval pppargs=\$ppp_${i}_args
- # Switch on NAT mode?
- #
- case ${ppp_nat} in
- [Yy][Ee][Ss])
- ppp_command="${ppp_command} -nat"
- ;;
- esac
+ # If no profile-specific mode, use default mode
+ if [ -z "${pppmode}" -a -n "${ppp_mode}" ]; then
+ pppmode=$ppp_mode
+ fi
- ppp_command="${ppp_command} ${ppp_profile}"
+ # Establish ppp mode.
+ #
+ if [ "${pppmode}" != "ddial" \
+ -a "${pppmode}" != "direct" \
+ -a "${pppmode}" != "dedicated" \
+ -a "${pppmode}" != "background" ]; then
+ pppmode="auto"
+ fi
- echo "Starting ppp as \"${ppp_user}\""
- su -m ${ppp_user} -c "exec ${ppp_command}"
+ ppp_command="/usr/sbin/ppp -quiet ${pppargs} -${pppmode}"
+
+ # Switch on NAT mode?
+ #
+ case ${ppp_nat} in
+ [Yy][Ee][Ss])
+ ppp_command="${ppp_command} -nat"
+ ;;
+ esac
+
+ ppp_command="${ppp_command} ${i}"
+
+ echo "Starting ppp as \"${ppp_user}\""
+ su -m ${ppp_user} -c "exec ${ppp_command}"
+ done
;;
esac
--- multippp.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030122064210.02B7349>
