diff options
Diffstat (limited to 'usr/local')
-rw-r--r-- | usr/local/pkg/carp_settings.xml | 4 | ||||
-rw-r--r-- | usr/local/pkg/miniupnpd.inc | 4 | ||||
-rwxr-xr-x | usr/local/www/diag_logs_filter.php | 7 | ||||
-rwxr-xr-x | usr/local/www/diag_logs_filter_dynamic.php | 7 | ||||
-rw-r--r-- | usr/local/www/diag_packet_capture.php | 15 | ||||
-rwxr-xr-x | usr/local/www/diag_ping.php | 27 | ||||
-rw-r--r-- | usr/local/www/ifstats.php | 2 | ||||
-rw-r--r-- | usr/local/www/interfaces_lagg_edit.php | 2 | ||||
-rwxr-xr-x | usr/local/www/pkg_edit.php | 2 | ||||
-rw-r--r-- | usr/local/www/widgets/include/log.inc | 6 | ||||
-rwxr-xr-x | usr/local/www/wizard.php | 2 |
11 files changed, 15 insertions, 63 deletions
diff --git a/usr/local/pkg/carp_settings.xml b/usr/local/pkg/carp_settings.xml index 087a109..29c1ba9 100644 --- a/usr/local/pkg/carp_settings.xml +++ b/usr/local/pkg/carp_settings.xml @@ -181,7 +181,7 @@ $input_errors[] = "CARP sync IP must be the backup firewall IP! You cannot specify this firewalls IP in this location."; } } - $wanip = find_interface_ip(get_real_wan_interface()); + $wanip = get_interface_ip(); if($wanip == $_POST["synchronizetoip"]) $input_errors[] = "CARP sync IP must be the backup firewall's IP! You cannot specify this firewall's IP in this location."; } @@ -192,4 +192,4 @@ /* force a filter configure for syncing */ filter_configure(); </custom_add_php_command_late> -</packagegui>
\ No newline at end of file +</packagegui> diff --git a/usr/local/pkg/miniupnpd.inc b/usr/local/pkg/miniupnpd.inc index 0d80700..0f74540 100644 --- a/usr/local/pkg/miniupnpd.inc +++ b/usr/local/pkg/miniupnpd.inc @@ -25,7 +25,7 @@ function upnp_uuid() { /* md5 hash of wan mac */ - $uuid = md5(exec('arp -an -i '.get_real_wan_interface().' | /usr/bin/cut -d " " -f4')); + $uuid = md5(exec('arp -an -i '.get_real_interface().' | /usr/bin/cut -d " " -f4')); /* put uuid in correct format 8-4-4-4-12 */ return substr($uuid,0,8).'-'.substr($uuid,9,4).'-'.substr($uuid,13,4).'-'.substr($uuid,17,4).'-'.substr($uuid,21,12); } @@ -123,7 +123,7 @@ $upnp_config = $config['installedpackages']['miniupnpd']['config'][0]; $config_file = '/var/etc/miniupnpd.conf'; - $config_text = "ext_ifname=".get_real_wan_interface()."\n"; + $config_text = "ext_ifname=".get_real_interface()."\n"; $config_text .= "port=2189\n"; $ifaces_active = ''; diff --git a/usr/local/www/diag_logs_filter.php b/usr/local/www/diag_logs_filter.php index 11e7478..850a338 100755 --- a/usr/local/www/diag_logs_filter.php +++ b/usr/local/www/diag_logs_filter.php @@ -73,12 +73,9 @@ function conv_clog($logfile, $tail = 50) { $logarr = ""; /* make interface/port table */ $iftable = array(); - $iftable[$config['interfaces']['lan']['if']] = "LAN"; - $iftable[get_real_wan_interface()] = "WAN"; - /* optional if list */ - $iflist = get_configured_interface_with_descr(true); + $iflist = get_configured_interface_with_descr(); foreach ($iflist as $if => $ifdesc) - $iftable[$config['interfaces'][$if]['if']] = $ifdesc; + $iftable[get_real_interface($if)] = $ifdesc; $sor = isset($config['syslog']['reverse']) ? "-r" : ""; diff --git a/usr/local/www/diag_logs_filter_dynamic.php b/usr/local/www/diag_logs_filter_dynamic.php index 62de8fa..e91b4e1 100755 --- a/usr/local/www/diag_logs_filter_dynamic.php +++ b/usr/local/www/diag_logs_filter_dynamic.php @@ -68,12 +68,9 @@ function conv_clog_filter($logfile, $tail = 50) { /* make interface/port table */ $iftable = array(); - $iftable[$config['interfaces']['lan']['if']] = "LAN"; - $iftable[get_real_wan_interface()] = "WAN"; - /* optional if list */ - $iflist = get_configured_interface_with_descr(true); + $iflist = get_configured_interface_with_descr(); foreach ($iflist as $if => $ifdesc) - $iftable[$config['interfaces'][$if]['if']] = $ifdesc; + $iftable[get_real_interface($if)] = $ifdesc; $sor = isset($config['syslog']['reverse']) ? "-r" : ""; diff --git a/usr/local/www/diag_packet_capture.php b/usr/local/www/diag_packet_capture.php index 4ff4ed9..fa972ff 100644 --- a/usr/local/www/diag_packet_capture.php +++ b/usr/local/www/diag_packet_capture.php @@ -40,21 +40,6 @@ $fn = "packetcapture.cap"; $snaplen = 1500;//default packet length $count = 100;//default number of packets to capture -function get_interface_addr($if) { - global $config; - - $ifdescr = convert_friendly_interface_to_friendly_descr($if); - - /* find out interface name */ - if ($ifdescr == "wan") - $if = get_real_wan_interface(); - else - $if = $config['interfaces'][$ifdescr]; - - return $if; - -} - if ($_POST) { $do_tcpdump = true; $host = $_POST['host']; diff --git a/usr/local/www/diag_ping.php b/usr/local/www/diag_ping.php index e80aa76..e4cc4f4 100755 --- a/usr/local/www/diag_ping.php +++ b/usr/local/www/diag_ping.php @@ -68,31 +68,6 @@ if (!isset($do_ping)) { $count = DEFAULT_COUNT; } -function get_interface_addr($ifdescr) { - - global $config, $g; - - /* find out interface name */ - if ($ifdescr == "wan") - $if = get_real_wan_interface(); - else - $if = $config['interfaces'][$ifdescr]['if']; - - /* try to determine IP address and netmask with ifconfig */ - $ifconfiginfo = ""; - $matches = ""; - unset($ifconfiginfo); - exec("/sbin/ifconfig " . $if, $ifconfiginfo); - - foreach ($ifconfiginfo as $ici) { - if (preg_match("/inet (\S+)/", $ici, $matches)) { - return $matches[1]; - } - } - - return false; -} - include("head.inc"); ?> <body link="#000000" vlink="#000000" alink="#000000"> <? include("fbegin.inc"); ?> @@ -145,7 +120,7 @@ include("head.inc"); ?> echo("<strong>Ping output:</strong><br>"); echo('<pre>'); ob_end_flush(); - $ifaddr = get_interface_addr($interface); + $ifaddr = get_interface_ip($interface); if ($ifaddr) system("/sbin/ping -S$ifaddr -c$count " . escapeshellarg($host)); else diff --git a/usr/local/www/ifstats.php b/usr/local/www/ifstats.php index e35f35c..1e177cf 100644 --- a/usr/local/www/ifstats.php +++ b/usr/local/www/ifstats.php @@ -43,7 +43,7 @@ $if = $_GET['if']; - $realif = get_real_wan_interface($if); + $realif = get_real_interface($if); if(!$realif) $realif = $if; // Need for IPSec case interface. diff --git a/usr/local/www/interfaces_lagg_edit.php b/usr/local/www/interfaces_lagg_edit.php index 2268053..032e239 100644 --- a/usr/local/www/interfaces_lagg_edit.php +++ b/usr/local/www/interfaces_lagg_edit.php @@ -40,7 +40,7 @@ $portlist = get_interface_list(); $checklist = get_configured_interface_list(false, true); $realifchecklist = array(); foreach ($checklist as $tmpif) - $realifchecklist[get_real_wan_interface($tmpif)] = $tmpif; + $realifchecklist[get_real_interface($tmpif)] = $tmpif; $id = $_GET['id']; if (isset($_POST['id'])) diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php index caf2044..67a4382 100755 --- a/usr/local/www/pkg_edit.php +++ b/usr/local/www/pkg_edit.php @@ -643,7 +643,7 @@ function fixup_string($string) { $newstring = str_replace("\$myurl", $myurl, $string); $string = $newstring; // fixup #2: $wanip - $curwanip = get_current_wan_address(); + $curwanip = get_interface_ip(); $newstring = str_replace("\$wanip", $curwanip, $string); $string = $newstring; // fixup #3: $lanip diff --git a/usr/local/www/widgets/include/log.inc b/usr/local/www/widgets/include/log.inc index 74d7c17..e1e8c3f 100644 --- a/usr/local/www/widgets/include/log.inc +++ b/usr/local/www/widgets/include/log.inc @@ -19,11 +19,9 @@ function conv_clog_filter($logfile, $tail = 8) { $logarr = ""; /* make interface/port table */ $iftable = array(); - $iftable[$config['interfaces']['lan']['if']] = "LAN"; - $iftable[get_real_wan_interface()] = "WAN"; - $iflist = get_configured_interface_with_descr(true); + $iflist = get_configured_interface_with_descr(); foreach ($iflist as $ifl => $ifdesc) - $iftable[$config['interfaces'][$if]['if']] = $ifdesc; + $iftable[get_real_interface($ifl)] = $ifdesc; $sor = isset($config['syslog']['reverse']) ? "-r" : ""; diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php index c9dae67..9fd214f 100755 --- a/usr/local/www/wizard.php +++ b/usr/local/www/wizard.php @@ -614,7 +614,7 @@ function fixup_string($string) { $myurl = $proto . "://" . $config['interfaces']['lan']['ipaddr'] . $urlport . "/"; $newstring = str_replace("\$myurl", $myurl, $newstring); // fixup #2: $wanip - $curwanip = get_current_wan_address(); + $curwanip = get_interface_ip(); $newstring = str_replace("\$wanip", $curwanip, $newstring); // fixup #3: $lanip $lanip = $config['interfaces']['lan']['ipaddr']; |