bundles/systemd-networkd: fix bridge-in-bridge-setup on home.nas not working properly
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
2662fa5976
commit
61e5591628
3 changed files with 55 additions and 12 deletions
|
@ -11,12 +11,14 @@ defaults = {
|
|||
|
||||
@metadata_reactor.provides(
|
||||
'interfaces',
|
||||
'systemd-networkd/bridges',
|
||||
)
|
||||
def add_vlan_infos_to_interface(metadata):
|
||||
interfaces = {}
|
||||
bridges = {}
|
||||
|
||||
for iface in metadata.get('interfaces', {}):
|
||||
if not '.' in iface:
|
||||
if '.' not in iface:
|
||||
continue
|
||||
|
||||
interface,vlan = iface.split('.')
|
||||
|
@ -24,6 +26,21 @@ def add_vlan_infos_to_interface(metadata):
|
|||
interfaces.setdefault(interface, {}).setdefault('vlans', set())
|
||||
interfaces[interface]['vlans'].add(vlan)
|
||||
|
||||
for bridge, config in metadata.get('systemd-networkd/bridges', {}).items():
|
||||
for iface in config.get('match', {}):
|
||||
if '.' not in iface:
|
||||
continue
|
||||
|
||||
interface,vlan = iface.split('.')
|
||||
|
||||
bridges.setdefault(interface, {}).setdefault('vlans', set())
|
||||
bridges[interface]['vlans'].add(vlan)
|
||||
|
||||
interfaces.setdefault(iface, {'ignore': True})
|
||||
|
||||
return {
|
||||
'interfaces': interfaces,
|
||||
'systemd-networkd': {
|
||||
'bridges': bridges,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue