mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Add support for PPP cards to get_real_interface()
This commit is contained in:
parent
b4d3639286
commit
859451697b
@ -2210,17 +2210,28 @@ function get_real_interface($interface = "wan") {
|
||||
case "enc0":
|
||||
$wanif = "enc0";
|
||||
break;
|
||||
/* XXX: dial in support?!
|
||||
case "ppp":
|
||||
$wanif = "ppp";
|
||||
break;
|
||||
*/
|
||||
default:
|
||||
$iflist = get_configured_interface_with_descr(false, true);
|
||||
|
||||
foreach ($iflist as $if => $ifdesc) {
|
||||
if ($interface == $if || $interface == $ifdesc) {
|
||||
|
||||
// PPP Support
|
||||
if($config['interfaces'][$if]['serialport']) {
|
||||
$dev = $config['interfaces'][$if]['serialport'];
|
||||
$ps = trim(`ps awux | grep -v grep | grep "$dev" | awk '{ print \$2 }'`);
|
||||
if($ps) {
|
||||
$int = trim(`ifconfig | grep -v grep | grep -B2 "$ps" | head -n1 | cut -d: -f1`);
|
||||
if($int) {
|
||||
$wanif = $int;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$cfg = $config['interfaces'][$if];
|
||||
|
||||
if (empty($cfg['ipaddr'])) {
|
||||
@ -2670,4 +2681,4 @@ function setup_pppoe_reset_file($interface, $status) {
|
||||
unlink_if_exists(CRON_PPPOE_CMD_FILE);
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user