Skip to content
  • Thomas Haller's avatar
    ifcfg-rh: always honor "$VLAN_ID" in ifcfg files · 5d6532f2
    Thomas Haller authored
    initscripts don't support "$VLAN_ID". They actually support "$VID",
    which NetworkManager doesn't.
    
    "$VLAN_ID" was introduced by commit 10b32be3 ('ifcfg-rh: various VLAN
    cleanups'). It has a comment about "backward compatibility" for the case
    where the reader would ignore "$VLAN_ID" if "$DEVICE"'s name contains
    a suffix that is parsable as VLAN ID.
    
    That is wrong. If a new feature gets introduce (like NetworkManager
    supporting "$VLAN_ID"), then there is no way that an older version of the
    tool -- which doesn't know the new feature yet (initscripts) -- supports it.
    This is not what backward compatibility means. Backward compatibility
    means that if a user has an old ifcfg-file without "$VLAN_ID", then we
    continue parsing it as before.
    
    Consider, when a user (or NetworkManager) writes a configuration
    
      DEVICE=vlan9
      PHYSDEV=eth0
      VLAN_ID=10
    
    then it makes no sense to ignore VLAN_ID=10 and use "9" instead.
    Otherwise the user (or NetworkManager) should not have written the
    file this way.
    
    Also, NetworkManager profiles support "connection.interface-name=vlan9"
    together with "vlan.id=10". Such a configuration is valid and must be
    expressible in ifcfg-rh format. The ifcfg-rh writer code did not somehow
    restrict the setting of "$VLAN_ID" to account for this odd behavior. Whenever
    NetworkManager in the past wrote VLAN_ID variable to file, it really meant
    it.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1907960
    
    NetworkManager/NetworkManager!794
    5d6532f2