Changeset 13929 in genesis for tools


Ignore:
Timestamp:
Jun 21, 2017, 9:32:38 PM (7 years ago)
Author:
rick
Message:

Fix invalid interfaces list with DHCP on alias

When DHCP is configured on a bridge alias it should use the 'real' interface
to listen for DHCP requests instead of the bridgeX.aliasY generated ones.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r13927 r13929  
    238238          datadump[key]['autogen_ifname'] = 'wlan%i' % wlan_count
    239239          datadump[key]['autogen_iface'] = 'wlan%i' % wlan_count
     240          datadump[key]['autogen_if_dhcp'] = 'wlan%i' % wlan_count
    240241          wlan_count += 1
    241242        else:
     243          datadump[key]['autogen_if_dhcp'] = datadump[key]['autogen_ifbase']
    242244          datadump[key]['autogen_ifname'] = '_'.join(key.split('_')[1:])
    243245          if len(key.split('_')) > 2 and key.split('_')[2].isdigit():
     
    251253      raise
    252254
    253     dhcp_interfaces = [datadump[key]['autogen_ifname'] for key in datadump['autogen_iface_keys'] \
     255    dhcp_interfaces = [datadump[key]['autogen_if_dhcp'] for key in datadump['autogen_iface_keys'] \
    254256      if dhcp_type(datadump[key]) == DHCP_SERVER]
    255257
    256     datadump['autogen_dhcp_interfaces'] = [x.replace('_','.') for x in dhcp_interfaces]
     258    datadump['autogen_dhcp_interfaces'] = [x.replace('_','.') for x in set(dhcp_interfaces)]
    257259    datadump['autogen_item'] = item
    258260
Note: See TracChangeset for help on using the changeset viewer.