Fix a few small bugs in new PPP code, and one type in pfsense-utils.inc

This commit is contained in:
gnhb 2010-03-29 14:29:15 +07:00
parent a728d6f91e
commit a216a03a00
2 changed files with 5 additions and 7 deletions

View File

@ -971,7 +971,6 @@ EOD;
$mpdconf .= <<<EOD
# Create link.
create link static lnk{$interface} modem
# We expect to be authenticated by peer using any protocol.
set link disable chap pap
set link accept chap pap eap
set link enable no-orig-auth
@ -983,9 +982,8 @@ EOD;
if (!empty($ppp['username'])) {
$mpdconf .= <<<EOD
# Configure the account name. Password will be taken from mpd.secret.
set auth authname "{$ppp['username']}"
set auth password "{$ppp['password']}"
set auth password "{$ppp['password']}"
EOD;
}
@ -1035,7 +1033,7 @@ EOD;
$fdlnkq = fopen("{$g['varetc_path']}/mpd_{$interface}.query", "w");
if (!$fdlnkq) {
/* NOTE: It is not fatal if we cannot write the query.");
/* NOTE: It is not fatal if we cannot write the query.") */
log_error("Error: cannot open mpd_{$interface}.query in interface_ppp_configure().\n");
} else {
$linkquery = <<<EOD

View File

@ -1230,7 +1230,7 @@ function get_interface_info($ifdescr) {
$ifinfo['macaddr'] = $ifinfotmp['macaddr'];
$ifinfo['ipaddr'] = $ifinfotmp['ipaddr'];
$ifinfo['subnet'] = $ifinfotmp['subnet'];
if (isset($ififnotmp['link0']))
if (isset($ifinfotmp['link0']))
$link0 = "down";
@ -1319,8 +1319,8 @@ function get_interface_info($ifdescr) {
if (empty($dev))
break;
if (file_exists("/dev/{$dev}")) {
$ifinfo['ppplink'] = $dev;
if (file_exists("{$g['varrun_path']}/mpd_{$if}.pid") && file_exists("{$g['varetc_path']}/mpd_{$if}.query")) {
$ifinfo['ppplink'] = $ifinfo['if'];
if (file_exists("{$g['varrun_path']}/ppp_{$if}.pid") && file_exists("{$g['varetc_path']}/mpd_{$if}.query")) {
$pppid = substr($ifinfo['if'], 3);
$sec = trim(`/usr/bin/nc 127.0.0.1 500{$pppid} < {$g['varetc_path']}/mpd_{$if}.query | grep 'Session time' | cut -f7 -d ' '`);
$ifinfo['ppp_uptime'] = convert_seconds_to_hms($sec);