NetworkManager/clients/common
Thomas Haller 5b9bc174d1 dhcp: don't load IPv4 client-id from lease file
The client-id is something that we want to determine top-down.
Meaning, if the user specifies it via ipv4.dhcp-client-id, then it
should be used. If the user leaves it unspecified, we choose a
default stable client-id. For the internal DHCP plugin, this is
a node specific client-id based on

  - the predictable interface name
  - and /etc/machine-id

It's not clear, why we should allow specifying the client-id in
the lease file as a third source of configuration. It really pushes
the configuration first down (when we do DHCP without lease file),
to store an additional bit of configuration for future DHCP attempts.

If the machine-id or the interface-name changes, then so does the
default client-id. In this case, also "ipv4.dhcp-client-id=stable"
changes. It's fair to require that the user keeps the machine-id
stable, if the machine identity doesn't change.

Also, the lease files are stored in /var/lib/NetworkManager, which
is more volatile than /etc/machine-id. So, if we think that machine-id
and interface-name is not stable, why would we assume that we have
a suitable lease file?

Also, if you do:

   nmcli connection add con-name "$PROFILE" ... ipv4.dhcp-client-id ''
   nmcli connection up $PROFILE
   nmcli connection modify "$PROFILE" ipv4.dhcp-client-id mac
   nmcli connection up $PROFILE
   nmcli connection modify "$PROFILE" ipv4.dhcp-client-id ''
   nmcli connection up $PROFILE

wouldn't you expect that the original (default) client-id is used again?

Also, this works badly with global connection defaults in
NetworkManager.conf. If you configure a connection default, previously
already this would always force the client-id and overrule the lease.
That is reasonable, but in which case would you ever want to use
the client-id from the lease?
2018-11-13 19:09:34 +01:00
..
tests build: meson: add prefix to test names 2018-04-12 09:21:10 +02:00
meson.build libnm, cli, ifcfg-rh: add NMSettingEthtool setting 2018-08-10 10:38:19 +02:00
nm-client-utils.c cli: drop NMCTriStateValue for NMTernary 2018-08-10 10:38:19 +02:00
nm-client-utils.h cli: drop NMCTriStateValue for NMTernary 2018-08-10 10:38:19 +02:00
nm-meta-setting-access.c libnm: use NMMetaSettingInfo for tracking setting priority 2018-08-10 10:38:19 +02:00
nm-meta-setting-access.h cli: remove unused argument from nm_meta_selection_create_parse_list() 2018-07-25 17:08:37 +02:00
nm-meta-setting-desc.c cli: minor cleanup of _set_fcn_gobject_enum() 2018-10-17 16:22:34 +02:00
nm-meta-setting-desc.h cli: fix handling uint64 connection property "serial.send-delay" 2018-10-17 16:22:34 +02:00
nm-polkit-listener.c docs: misc. typos 2018-09-15 09:08:03 +02:00
nm-polkit-listener.h docs: misc. typos 2018-09-15 09:08:03 +02:00
nm-secret-agent-simple.c clients/secret-agent-simple: support auth helpers 2018-10-22 18:15:25 +02:00
nm-secret-agent-simple.h cli: fix reading "vpn.secrets.*" from passwd-file 2018-09-14 15:17:53 +02:00
nm-vpn-helpers.c all: use the elvis operator wherever possible 2018-05-10 14:36:58 +02:00
nm-vpn-helpers.h clients: drop redundant #include "NetworkManager.h" 2018-01-08 12:38:54 +01:00
settings-docs.h.in dhcp: don't load IPv4 client-id from lease file 2018-11-13 19:09:34 +01:00
settings-docs.xsl cli: fix marking settings docs for translation 2017-04-23 23:45:02 +02:00