summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorgnhb <gnoahb@gmail.com>2010-06-08 22:32:25 +0700
committergnhb <gnoahb@gmail.com>2010-06-08 22:32:25 +0700
commit8256f324086c5c85f02663aa729f6bb52aed827a (patch)
treeb6b8514cb3fbd4c55154f82f9033424731586f35 /etc
parent743994a651e76254f2f079e896efd5cf5f3a29b3 (diff)
downloadpfsense-8256f324086c5c85f02663aa729f6bb52aed827a.zip
pfsense-8256f324086c5c85f02663aa729f6bb52aed827a.tar.gz
Fix all issues that Ermal found.
Interfaces.php problems. 1- When creating a pppoe ptpid on the config is empty(<<ptpid/>). 2- after switching from pppoe to pptp in the config there remains pppoe-reset-type which is not that much of a bug but needs to be fixed. 3- When choosing ppp type even though i do not have a device i am allowed to save. After saving it switches to none type automatically. The <ppp> section still has values of pptp config and some of pppoe and only the apn related to ppp. The interface assignment still has teh interface pptp1! (This is quite buggy i would say.) Interfaces -> assign 1- After doing all the tests on interfaces.php everything is shown with ppp() on interfaces.php picture attached. (probably an issue with how you do find ppp interfaces around.) 2- MPD is started even though the interface is not enabled after assignment. 3- During assignment as i tell you even below remove teh pptpid from the interface an duse interface name. Interfaces -> assign -> ppp 1- I have an emtpy thing in there when i do all the actions on interfaces.php
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/interfaces.inc31
-rw-r--r--etc/inc/upgrade_config.inc2
2 files changed, 18 insertions, 15 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 331b101..a985ff8 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -62,7 +62,7 @@ function get_interface_arr($flush = false) {
/* If the cache doesn't exist, build it */
if (!isset($interface_arr_cache) or $flush)
- $interface_arr_cache = explode(" ", `/sbin/ifconfig -l`);
+ $interface_arr_cache = explode(" ", trim(`/sbin/ifconfig -l`));
return $interface_arr_cache;
}
@@ -72,16 +72,16 @@ function get_interface_arr($flush = false) {
* detected.
*/
function does_interface_exist($interface) {
- global $config;
-
- if(!$interface)
- return false;
+ global $config;
+
+ if(!$interface)
+ return false;
- $ints = get_interface_arr();
+ $ints = get_interface_arr();
if (in_array($interface, $ints))
- return true;
- else
- return false;
+ return true;
+ else
+ return false;
}
function interfaces_loopback_configure() {
@@ -861,7 +861,7 @@ function interface_bring_down($interface = "wan", $destroy = false) {
}
/* This function can configure PPPoE, MLPPP (PPPoE), PPtP.
-* It writes the mpd config file to /var/etc every time the interfaces is brought up.
+* It writes the mpd config file to /var/etc every time the link is opened.
*/
function interface_ppps_configure($interface) {
@@ -887,7 +887,10 @@ function interface_ppps_configure($interface) {
log_error("Can't find PPP config with ptpid {$ifcfg['ptpid']} in interface_ppps_configure().");
return 0;
}
-
+ if (!isset($ifcfg['enable'])) {
+ log_error("{$interface} is not enabled.");
+ return 0;
+ }
$pppif = $ifcfg['if'];
if ($ppp['type'] == "ppp")
$type = "modem";
@@ -3114,7 +3117,7 @@ function find_interface_ip($interface, $flush = false)
$interface = str_replace("\n", "", $interface);
- if (does_interface_exist($interface) == false)
+ if (!does_interface_exist($interface))
return;
/* Setup IP cache */
@@ -3157,8 +3160,8 @@ function get_interface_ip($interface = "wan")
$curip = find_interface_ip($realif);
if ($curip && is_ipaddr($curip) && ($curip != "0.0.0.0"))
return $curip;
-
- return null;
+ else
+ return null;
}
function get_interface_subnet($interface = "wan")
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index d732fed..f9a0482 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -1985,7 +1985,7 @@ function upgrade_063_to_064() {
if (!isset($ppp['ptpid'])){
$config['ppps']['ppp'][$pppid]['ptpid'] = uniqid('', true);
}
- if (isset($ppp['defaultgw'])){
+ if (isset($ppp['defaultgw']))
unset($config['ppps']['ppp'][$pppid]['defaultgw']);
}
}
OpenPOWER on IntegriCloud