From owner-freebsd-bugs Tue Jan 21 22:50: 7 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0662E37B401 for ; Tue, 21 Jan 2003 22:50:04 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id F143943F3F for ; Tue, 21 Jan 2003 22:50:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h0M6o2NS071771 for ; Tue, 21 Jan 2003 22:50:02 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h0M6o2Q8071770; Tue, 21 Jan 2003 22:50:02 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F0A4337B401 for ; Tue, 21 Jan 2003 22:42:27 -0800 (PST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by mx1.FreeBSD.org (Postfix) with ESMTP id B68F243EB2 for ; Tue, 21 Jan 2003 22:42:21 -0800 (PST) (envelope-from root@chrullrich.de) Received: from [212.227.126.160] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 18bEaa-00025t-00 for FreeBSD-gnats-submit@freebsd.org; Wed, 22 Jan 2003 07:42:20 +0100 Received: from [217.237.101.80] (helo=ser1.chrullrich.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 18bEaa-00025p-00 for FreeBSD-gnats-submit@freebsd.org; Wed, 22 Jan 2003 07:42:20 +0100 Received: by ser1.chrullrich.de (Postfix, from userid 0) id 02B7349; Wed, 22 Jan 2003 07:42:10 +0100 (CET) Message-Id: <20030122064210.02B7349@ser1.chrullrich.de> Date: Wed, 22 Jan 2003 07:42:10 +0100 (CET) From: Christian Ullrich Reply-To: Christian Ullrich To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/47350: rc.network supports only one ppp profile Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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