r4316 JunOS gateway: bugfix
authorAlexey Andriyanov <alan@al-an.info>
Thu, 10 Mar 2011 16:22:02 +0000 (16:22 +0000)
committerAlexey Andriyanov <alan@al-an.info>
Thu, 10 Mar 2011 16:22:02 +0000 (16:22 +0000)
jun10TranslatePushQueue: avoiding appearing of the vlan in both members and native

wwwroot/inc/deviceconfig.php

index 7da93cbd40ca79599a126c849bc0e72a68c1a9c6..9cbaed377743a1829c932536493269f5768a8836 100644 (file)
@@ -1211,9 +1211,19 @@ function jun10TranslatePushQueue ($queue, $vlan_names)
                        break;
                case 'set native':
                        $ret .= "set interfaces ${cmd['arg1']} unit 0 family ethernet-switching native-vlan-id ${cmd['arg2']}\n";
+                       $pre = "delete interfaces ${cmd['arg1']} unit 0 family ethernet-switching vlan members";
+                       $vlan = $cmd['arg2'];
+                       $ret .= "$pre $vlan\n";
+                       if (isset ($vlan_names[$vlan]))
+                               $ret .= "$pre ${vlan_names[$vlan]}\n";
                        break;
                case 'unset native':
                        $ret .= "delete interfaces ${cmd['arg1']} unit 0 family ethernet-switching native-vlan-id\n";
+                       $pre = "interfaces ${cmd['arg1']} unit 0 family ethernet-switching vlan members";
+                       $vlan = $cmd['arg2'];
+                       if (isset ($vlan_names[$vlan]))
+                               $ret .= "delete $pre ${vlan_names[$vlan]}\n";
+                       $ret .= "set $pre $vlan\n";
                        break;
                case 'set access':
                        $ret .= "set interfaces ${cmd['arg1']} unit 0 family ethernet-switching vlan members ${cmd['arg2']}\n";