Setting tag pyplnet-4.3-13
[pyplnet.git] / plnet.py
index 540a699..2714af5 100755 (executable)
--- a/plnet.py
+++ b/plnet.py
@@ -110,8 +110,12 @@ def InitInterfaces(logger, plc, data, root="", files_only=False, program="NodeMa
 
             for setting in settings:
                 settingname = setting[name_key].upper()
-                if settingname in ('IFNAME','ALIAS','CFGOPTIONS','DRIVER'):
+                if settingname in ('IFNAME','ALIAS','CFGOPTIONS','DRIVER','VLAN'):
                     details[settingname]=setting['value']
+                # IPv6 support on IPv4 interface
+                if settingname in ('IPV6ADDR','IPV6_DEFAULTGW','IPV6ADDR_SECONDARIES'):
+                    details[settingname]=setting['value']
+                    details['IPV6INIT']='yes'
                 # wireless settings
                 elif settingname in \
                         [  "MODE", "ESSID", "NW", "FREQ", "CHANNEL", "SENS", "RATE",
@@ -155,14 +159,10 @@ def InitInterfaces(logger, plc, data, root="", files_only=False, program="NodeMa
             else:
                 logger.log("net:InitInterfaces WARNING: interface alias (%s) not matched to an interface"% details['ALIAS'])
             device_id -= 1
-        elif 'BRIDGE' in details:
-            #The bridge inherits the mac of the first attached interface.
-            if 'IFNAME' in details:
-                ifname = details['IFNAME']
-                device_id -= 1
-            else:
-                ifname = 'eth0'
-                device_id -= 1
+        elif 'BRIDGE' in details and 'IFNAME' in details:
+            # The bridge inherits the mac of the first attached interface.
+            ifname = details['IFNAME']
+            device_id -= 1
             logger.log('net:InitInterfaces: Bridge detected. Adding %s to devices_map' % ifname)
             devices_map[ifname] = removeBridgedIfaceDetails(details)
             bridgeName = details['BRIDGE']
@@ -459,8 +459,6 @@ if __name__ == "__main__":
     parser.add_option("-p", "--program", action="store", type="string",
                       dest="program", default="plnet")
     (options, args) = parser.parse_args()
-    options.root = ''
-    options.verbose = True
     if len(args) != 1 or options.root is None:
         print sys.argv
         print >>sys.stderr, "Missing root or node_id"