From db2b0ff27c68907bca859db4870855816ac60b04 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 25 Apr 2019 09:25:40 +0200 Subject: [PATCH] interfaces: allow link-local address on bridges; closes #926 --- src/etc/inc/interfaces.inc | 2 + src/www/interfaces_bridge.php | 61 ++++++++++++++++-------------- src/www/interfaces_bridge_edit.php | 29 ++++++++++++-- 3 files changed, 59 insertions(+), 33 deletions(-) diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index e26c2997a..80398f3f2 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -390,6 +390,8 @@ function interface_bridge_configure(&$bridge, $checkmember = 0) $bridge['bridgeif'] = $bridgeif; } + mwexecf('/sbin/ifconfig %s inet6 %sauto_linklocal', array($bridgeif, isset($bridge['linklocal']) ? '' : '-')); + $checklist = get_configured_interface_with_descr(); /* Add interfaces to bridge */ diff --git a/src/www/interfaces_bridge.php b/src/www/interfaces_bridge.php index a561ba920..cd29edc8c 100644 --- a/src/www/interfaces_bridge.php +++ b/src/www/interfaces_bridge.php @@ -1,36 +1,35 @@ + @@ -130,7 +129,7 @@ $main_buttons = array( $ifdescrs = get_configured_interface_with_descr(); foreach ($a_bridges as $bridge): ?> - + + @@ -167,4 +167,7 @@ $main_buttons = array( - + + $bdescr) { } } - if ($_SERVER['REQUEST_METHOD'] === 'GET') { // read form data if (!empty($a_bridges[$_GET['id']])) { @@ -57,8 +56,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig[$fieldname] = null; } } + // bool fields - $pconfig['enablestp'] = isset($a_bridges[$id]['enablestp']); + $pconfig['enablestp'] = !empty($a_bridges[$id]['enablestp']); + $pconfig['linklocal'] = !empty($a_bridges[$id]['linklocal']); // simple array fields $array_fields = array('members', 'stp', 'edge', 'autoedge', 'ptp', 'autoptp', 'static', 'private'); @@ -144,7 +145,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { if (count($input_errors) == 0) { $bridge = array(); - $bridge['enablestp'] = !empty($pconfig['enablestp']); + // booleans + foreach (['enablestp', 'linklocal'] as $fieldname) { + if (!empty($pconfig[$fieldname])) { + $bridge[$fieldname] = true; + } + } // 1 on 1 copy $copy_fields = array('descr', 'maxaddr', 'timeout', 'bridgeif', 'maxage','fwdelay', 'hellotime', 'priority', 'proto', 'holdcnt'); foreach ($copy_fields as $fieldname) { @@ -272,6 +278,18 @@ $(document).ready(function() { + + + + /> + + + + @@ -636,4 +654,7 @@ $(document).ready(function() { - + +