Add support for hardwiring ppp sessions to particular devices with new

per-profile variables of the form ppp_<profile>_unit.  No ppp_unit
variable is supported since tying the same unit to more than one profile
won't work.

PR:		conf/122127
MFC after:	1 week
This commit is contained in:
Brooks Davis 2008-03-28 07:57:52 +00:00
parent b31eb9bec0
commit 14b0729b93
2 changed files with 17 additions and 2 deletions

View File

@ -18,7 +18,7 @@ start_postcmd="ppp_poststart"
ppp_start_profile()
{
local _ppp_profile _ppp_mode _ppp_nat
local _ppp_profile _ppp_mode _ppp_nat _ppp_unit
_ppp_profile=$1
_ppp_profile_cleaned=$1
@ -59,6 +59,13 @@ ppp_start_profile()
;;
esac
# Check for hard wired unit
eval _ppp_unit=\$ppp_${_ppp_profile_cleaned}_unit
if [ -n "_ppp_unit" ]; then
_ppp_unit="-unit${_ppp_unit}"
fi
rc_flags="$rc_flags $_ppp_unit"
# Run!
#
su -m $ppp_user -c "$command ${rc_flags} ${_ppp_profile}"

View File

@ -1322,7 +1322,9 @@ The name of the profile to use from
Also used for per-profile overrides of
.Va ppp_mode
and
.Va ppp_nat .
.Va ppp_nat ,
and
.Va ppp_ Ns Ao Ar profile Ac Ns _unit .
When the profile name contains any of the characters
.Dq Li .-/+
they are translated to
@ -1361,6 +1363,12 @@ Overrides the global
.Va ppp_nat
for
.Ar profile .
.It Va ppp_ Ns Ao Ar profile Ac Ns _unit
.Pq Vt int
Set the unit number to be used for this profile.
See the manual description of
.Fl unit Ns Ar N
for details.
.It Va ppp_user
.Pq Vt str
The name of the user under which