summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/interfaces.inc13
-rw-r--r--etc/inc/pfsense-utils.inc31
-rw-r--r--etc/inc/util.inc2
-rw-r--r--usr/local/www/interfaces_ppp_edit.php8
-rwxr-xr-xusr/local/www/status_interfaces.php6
5 files changed, 34 insertions, 26 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index f2ad8d4..65e3996 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -969,24 +969,27 @@ EOD;
}
$mpdconf .= <<<EOD
-# Create link.
create link static lnk{$interface} modem
set link disable chap pap
set link accept chap pap eap
set link enable no-orig-auth
-# To make Ringback work we should specify how to handle incoming calls originated by it.
#set link enable incoming
set link action bundle {$interface}
EOD;
- if (!empty($ppp['username'])) {
+ if (empty($ppp['username'])) {
+ $ppp['username'] = "user";
+ $ppp['password'] = "none";
+ }
+ if (empty($ppp['password']))
+ $ppp['password'] = "none";
+
$mpdconf .= <<<EOD
set auth authname "{$ppp['username']}"
- set auth password "{$ppp['password']}"
+ set auth password {$ppp['password']}
EOD;
- }
$mpdconf .= <<<EOD
set modem device {$ppp['port']}
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index f9158d7..7a27a81 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -1275,6 +1275,11 @@ function get_interface_info($ifdescr) {
$ifinfo['outpkts'] = $in4_pass_packets + $out4_block_packets;
$ifconfiginfo = "";
+
+ unset($linkinfo);
+ exec("/usr/bin/netstat -I " . $ifinfo['if'] . " -nWb -f link", $linkinfo);
+ $linkinfo = preg_split("/\s+/", $linkinfo[1]);
+
switch ($config['interfaces'][$ifdescr]['ipaddr']) {
/* DHCP? -> see if dhclient is up */
case "dhcp":
@@ -1288,9 +1293,6 @@ function get_interface_info($ifdescr) {
break;
/* PPPoE interface? -> get status from virtual interface */
case "pppoe":
- unset($linkinfo);
- exec("/usr/bin/netstat -I " . $ifinfo['if'] . " -nWb -f link", $linkinfo);
- $linkinfo = preg_split("/\s+/", $linkinfo[1]);
if ("{$ifinfo['if']}*" == $linkinfo[0])
$ifinfo['pppoelink'] = "down";
else if ($ifinfo['if'] == $linkinfo[0] && !isset($link0))
@@ -1302,9 +1304,6 @@ function get_interface_info($ifdescr) {
break;
/* PPTP interface? -> get status from virtual interface */
case "pptp":
- unset($linkinfo);
- exec("/usr/bin/netstat -I " . $ifinfo['if'] . " -nWb -f link", $linkinfo);
- $linkinfo = preg_split("/\s+/", $linkinfo[1]);
if ("{$ifinfo['if']}*" == $linkinfo[0])
$ifinfo['pptplink'] = "down";
else if ($ifinfo['if'] == $linkinfo[0] && !isset($link0))
@@ -1315,20 +1314,28 @@ function get_interface_info($ifdescr) {
break;
/* PPP interface? -> get uptime for this session and cumulative uptime from the persistant log file in conf */
case "ppp":
+ if ("{$ifinfo['if']}*" == $linkinfo[0])
+ $ifinfo['ppplink'] = "down";
+ else if ($ifinfo['if'] == $linkinfo[0])
+ $ifinfo['ppplink'] = "up";
+ else
+ $ifinfo['ppplink'] = "down" ;
+ if (empty($ifinfo['status']))
+ $ifinfo['status'] = "down";
+
$dev = $config['interfaces'][$if]['if'];
if (empty($dev))
break;
if (file_exists("/dev/{$dev}")) {
- $ifinfo['ppplink'] = $ifinfo['if'];
if (file_exists("{$g['varrun_path']}/ppp_{$if}.pid") && file_exists("{$g['varetc_path']}/mpd_{$if}.query")) {
+ $ifinfo['pppinfo'] = "{$ifinfo['if']}";
$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);
- }
- $ifinfo['missing_device'] = 0;
+ $ifinfo['ppp_uptime'] = convert_seconds_to_hms($sec);
+ }
} else {
- $ifinfo['ppplink'] = $dev . " device not present! Is the modem attached to the system?";
- $ifinfo['missing_device'] = 1;
+ $ifinfo['nodevice'] = 1;
+ $ifinfo['pppinfo'] = $dev . " device not present! Is the modem attached to the system?";
}
// Calculate cumulative uptime for PPP link. Useful for connections that have per minute/hour contracts so you don't go over!
$ifinfo['ppp_uptime_accumulated'] = get_ppp_uptime($dev);
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 584beb3..3c61b6c 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -1117,7 +1117,7 @@ function is_interface_mismatch() {
$do_assign = false;
$i = 0;
foreach ($config['interfaces'] as $ifname => $ifcfg) {
- if (preg_match("/^enc|^tun|^ppp|^pptp|^pppoe|^ovpn|^gif|^gre|^lagg|^bridge|vlan|_wlan/i", $ifcfg['if'])) {
+ if (preg_match("/^enc|^cua|^ppp|^pptp|^pppoe|^ovpn|^gif|^gre|^lagg|^bridge|vlan|_wlan/i", $ifcfg['if'])) {
$i++;
}
else if (does_interface_exist($ifcfg['if']) == false) {
diff --git a/usr/local/www/interfaces_ppp_edit.php b/usr/local/www/interfaces_ppp_edit.php
index 9657466..f3aae99 100644
--- a/usr/local/www/interfaces_ppp_edit.php
+++ b/usr/local/www/interfaces_ppp_edit.php
@@ -137,12 +137,10 @@ if ($_POST) {
$ppp['descr'] = $_POST['descr'];
- $iflist = get_configured_interface_list();
- foreach ($iflist as $if) {
- if ($config['interfaces'][$if]['if'] == basename($a_ppps[$id]['port'])) {
+ $iflist = get_configured_interface_list();
+ foreach ($iflist as $if) {
+ if ($config['interfaces'][$if]['if'] == basename($a_ppps[$id]['port']))
$config['interfaces'][$if]['if'] = basename($ppp['port']);
- interface_ppp_configure($if);
- }
}
if (isset($id) && $a_ppps[$id])
diff --git a/usr/local/www/status_interfaces.php b/usr/local/www/status_interfaces.php
index 5ebde3d..eaa968b 100755
--- a/usr/local/www/status_interfaces.php
+++ b/usr/local/www/status_interfaces.php
@@ -138,12 +138,12 @@ include("head.inc");
<tr>
<td width="22%" class="vncellt">PPP</td>
<td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['ppplink']);?>&nbsp;&nbsp;
- <?php if ($ifinfo['status'] == "up"): ?>
+ <?=htmlspecialchars($ifinfo['pppinfo']);?>
+ <?php if ($ifinfo['ppplink'] == "up"): ?>
<a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>">
<input type="button" name="<?php echo $ifdescr; ?>" value="Disconnect" class="formbtns">
<?php else: ?>
- <?php if (!$ifinfo['missing_device']): ?>
+ <?php if (!$ifinfo['nodevice']): ?>
<a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>">
<input type="button" name="<?php echo $ifdescr; ?>" value="Connect" class="formbtns">
<?php endif; ?>
OpenPOWER on IntegriCloud