bugfix: Native vlan on Huawei trunk ports no longer gets to the allowed vlans list
authorxornet <founder.sl@gmail.com>
Tue, 13 May 2014 11:19:32 +0000 (15:19 +0400)
committerAlexey Andriyanov <alan@al-an.info>
Wed, 14 May 2014 18:26:16 +0000 (22:26 +0400)
ChangeLog
wwwroot/inc/deviceconfig.php

index e7d6163..79b5710 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
        bugfix: syntax error in functions.php when using PHP prior to 5.3.0 (#1195)
        bugfix: properly format comment text for locations and racks
        bugfix: the tab IP SLB/Load balancers displayed all the objects in system
+       bugfix: Native vlan on Huawei trunk ports no longer gets to the allowed vlans list
        update: allow connecting to a non-standard LDAP port (by Michał Sochoń)
        update: move port outer interfaces from the dictionary
 0.20.7 2014-03-03
index 8e76316..5186369 100644 (file)
@@ -753,7 +753,7 @@ function vrp53PickInterfaceSubcommand (&$work, $line)
                        $work['portdata'][$port_name] = array
                        (
                                'allowed' => $work['current']['allowed'],
-                               'native' => $work['current']['native'],
+                               'native' => in_array ($work['current']['native'], $work['current']['allowed']) ? $work['current']['native'] : 0,
                                'mode' => 'trunk',
                        );
                        break;
@@ -771,8 +771,6 @@ function vrp53PickInterfaceSubcommand (&$work, $line)
                $work['current']['native'] = $matches[1];
                if (!array_key_exists ('allowed', $work['current']))
                        $work['current']['allowed'] = array();
-               if (!in_array ($matches[1], $work['current']['allowed']))
-                       $work['current']['allowed'][] = $matches[1];
                break;
        case (preg_match ('@^ port link-type (.+)$@', $line, $matches)):
                $work['current']['link-type'] = $matches[1];
@@ -844,8 +842,6 @@ function vrp55Read8021QConfig ($input)
                // we get a problem).
                case preg_match ('/^ port (default|trunk pvid) vlan ([[:digit:]]+)$/', $line, $matches):
                        $ret['current']['native'] = $matches[2];
-                       if (!in_array ($ret['current']['native'], $ret['current']['allowed']))
-                               $ret['current']['allowed'][] = $ret['current']['native'];
                        break;
                case preg_match ('/^ port trunk allow-pass vlan (.+)$/', $line, $matches):
                        foreach (vrp53ParseVLANString ($matches[1]) as $vlan_id)