Skip to content
  • Thomas Haller's avatar
    core: persist the fake permanent hardware address to the device's statefile · 5912b2f9
    Thomas Haller authored
    On devices that have no real permanent hardware address (as returned
    by ethtool), we take the current MAC address of the device.
    
    Currently, NM is a bit flaky about whether to accept such fake permanent
    addresses for settings like keyfile.unmanaged-devices or the per-
    connection property ethernet.mac-address. Probably, we should allow
    using fake addresses there in general.
    
    However, that leads to problems because NetworkManager itself changes
    the current MAC address of such devices. For example when
    configuing
    
      keyfile.unmanaged-device=22:33:44:55:66:77
    
    and later activating a connection with
    
      ethernet.cloned-mac-address=22:33:44:55:66:77
    
    we have a strange situation after restart and the device becomes
    unmanaged.
    
    We are going to avoid that, by remembering the fake permanent address
    in the device state file.
    
    This only matters:
    
      - for devices that don't have a real permanent address (veth)
    
      - if the user or NetworkManager itself changed the MAC address
        of the device
    
      - after a restart of NetworkManager, without reboot. A reboot
        clears the device state for /var/run/NetworkManager.
    5912b2f9