aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/openospfd/openospfd.inc20
-rw-r--r--config/openospfd/openospfd_interfaces.xml1
2 files changed, 20 insertions, 1 deletions
diff --git a/config/openospfd/openospfd.inc b/config/openospfd/openospfd.inc
index e0764031..c131142a 100644
--- a/config/openospfd/openospfd.inc
+++ b/config/openospfd/openospfd.inc
@@ -27,6 +27,24 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+function ospfd_display_friendlyiface () {
+ global $evaledvar, $config, $g;
+
+ if (intval($g['latest_config']) >= 6)
+ return;
+
+ if ($evaledvar) {
+ foreach ($evaledvar as $idx => $field) {
+ if ($field['interface']) {
+ if (empty($config['interfaces'][$field['interface']]['descr']))
+ $evaledvar[$idx]['interface'] = strtoupper($evaledvar[$idx]['interface']);
+ else
+ $evaledvar[$idx]['interface'] = $config['interfaces'][$field['interface']]['descr'];
+ }
+ }
+ }
+}
+
function ospfd_install_conf() {
global $config, $g, $input_errors;
@@ -222,4 +240,4 @@ function is_ospfd_running() {
return false;
}
-?> \ No newline at end of file
+?>
diff --git a/config/openospfd/openospfd_interfaces.xml b/config/openospfd/openospfd_interfaces.xml
index e8b18fcf..445eefea 100644
--- a/config/openospfd/openospfd_interfaces.xml
+++ b/config/openospfd/openospfd_interfaces.xml
@@ -4,6 +4,7 @@
<title>Services: OpenOSPFd</title>
<include_file>/usr/local/pkg/openospfd.inc</include_file>
<aftersaveredirect>pkg.php?xml=openospfd_interfaces.xml</aftersaveredirect>
+ <custom_php_command_before_form>ospfd_display_friendlyiface();</custom_php_command_before_form>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
<chmod>077</chmod>