Skip to content
  • Thomas Haller's avatar
    libnm,core: make "default${CONNECTION}" the built-in stable ID · 21cf2dc5
    Thomas Haller authored
    The "connection.stable-id" supports placeholders like "${CONNECTION}" or
    "${DEVICE}".
    
    The stable-id can also be specified in global connection defaults in
    NetworkManager.conf, by leaving it unset in the profile. Global
    connection defaults always follow the pattern, that they correspond to a
    per-profile property, and only when the per-profile value indicates a
    special default/unset value, the global connection default is consulted.
    Finally, if the global connection default is also not configured in
    NetworkManager.conf, a built-in default is used (which may not be
    constant either, for example ipv6.ip6-privacy's built-in default depends
    on a sysctl value).
    
    In any case, every possible configuration that can be achieved should be
    configurable both per-profile and via global connection default. That
    was not given for the stable-id, because the built-in default generated
    an ID in a way that could not be explicitly expressed otherwise.
    
    So you could not:
    - explicitly set the per-profile value to the built-in default, to avoid
      that the global-connection-default overwrites it.
    - explicitly set the global-connection-default to the built-in default,
      to avoid that a lower priority [connection*] section overwrites the
      stable-id again.
    
    Fix that inconsistency to make it possible to explicitly set the
    built-in default.
    
    Change behavior for literally "default${CONNECTION}" and make it behave
    as the built-in default. Also document that the built-in default has that
    value.
    
    It's unlikely that this breaks an existing configuration, but of course,
    if any user configured "connection.stable-id=default${CONNECTION}", then
    the behavior changes for them.
    21cf2dc5