From: Wolfgang Bumiller Date: Thu, 25 Jun 2015 09:54:26 +0000 (+0200) Subject: read_etc_network_interfaces: improved parsing X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=48ab17b3eec31fdb89b8523f7ca2577fa87298c5;hp=48ab17b3eec31fdb89b8523f7ca2577fa87298c5;ds=sidebyside read_etc_network_interfaces: improved parsing * parsing ipv6 blocks * parsing extra lines like source/source-directory/... * merge multiple bridge_port lines into one * write options only once The returned config hash is not just the interface hash anymore. Interfaces are now in its 'ifaces' member hash. All unknown options (including mappings) end up in its 'options' hash. Added a comment describing the config hash's layout in detail. An interface can now have an ipv4 and an ipv6 entry, they will be returned as a single interface with address/netmask/gateway and address6/netmask6/gateway6 elements. Additionally a 'families' array is available listing which families are available. Ideally we'll at some point allow unhandled families to be kept too, however, now that extra lines like 'source' and 'source-directory' are preserved, it is recommended to move all custom configuration into separate files to not interfere with our interface parsing. Options such as bridge ports or ovs_* will now be written out only for the first interface. If multiple protocol families of a bridge contain bridge_ports lines they will be merged into the first interface. ---