r4026 exportSwitch8021QConfig(): make sure, that "(un)set native" command is always...
authorDenis Ovsienko <infrastation@yandex.ru>
Mon, 29 Nov 2010 19:16:27 +0000 (19:16 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Mon, 29 Nov 2010 19:16:27 +0000 (19:16 +0000)
ChangeLog
inc/functions.php

index 2fa5f92..3712dc2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
        update: cache image files thumbnails and make them JPEGs (#369, by Matt Mills)
        update: enhance rackspace click helpers (by Jeroen Benda)
 0.18.7
+       bugfix: adjust 802.1Q command generation
 0.18.6 2010-11-26
        bugfix: draw administrator's attention to missing LDAP extension (by Matt Mills)
        bugfix: minor issues on LiveCDP/LLDP tab
index 7400869..f74e4ec 100644 (file)
@@ -2856,12 +2856,13 @@ function exportSwitch8021QConfig
                        );
                        break;
                case 'trunk->access':
-                       $crq[] = array
-                       (
-                               'opcode' => 'unset native',
-                               'arg1' => $port_name,
-                               'arg2' => $port['old_native'],
-                       );
+                       if ($port['old_native'])
+                               $crq[] = array
+                               (
+                                       'opcode' => 'unset native',
+                                       'arg1' => $port_name,
+                                       'arg2' => $port['old_native'],
+                               );
                        if (count ($port['old_allowed']))
                                $crq[] = array
                                (
@@ -2939,12 +2940,13 @@ function exportSwitch8021QConfig
                                        'port' => $port_name,
                                        'vlans' => $port['new_allowed'],
                                );
-                       $crq[] = array
-                       (
-                               'opcode' => 'set native',
-                               'arg1' => $port_name,
-                               'arg2' => $port['new_native'],
-                       );
+                       if ($port['new_native'])
+                               $crq[] = array
+                               (
+                                       'opcode' => 'set native',
+                                       'arg1' => $port_name,
+                                       'arg2' => $port['new_native'],
+                               );
                        break;
                case 'trunk->access':
                        $crq[] = array