NetworkManager/src/core/devices
Thomas Haller e6a33c04eb
all: make "ipv6.addr-gen-mode" configurable by global default
It can be useful to choose a different "ipv6.addr-gen-mode". And it can be
useful to override the default for a set of profiles.

For example, in cloud or in a data center, stable-privacy might not be
the best choice. Add a mechanism to override the default via global defaults
in NetworkManager.conf:

  # /etc/NetworkManager/conf.d/90-ipv6-addr-gen-mode-override.conf
  [connection-90-ipv6-addr-gen-mode-override]
  match-device=type:ethernet
  ipv6.addr-gen-mode=0

"ipv6.addr-gen-mode" is a special property, because its default depends on
the component that configures the profile.

- when read from disk (keyfile and ifcfg-rh), a missing addr-gen-mode
  key means to default to "eui64".
- when configured via D-Bus, a missing addr-gen-mode property means to
  default to "stable-privacy".
- libnm's ip6-config::addr-gen-mode property defaults to
  "stable-privacy".
- when some tool creates a profile, they either can explicitly
  set the mode, or they get the default of the underlying mechanisms
  above.

  - nm-initrd-generator explicitly sets "eui64" for profiles it creates.
  - nmcli doesn' explicitly set it, but inherits the default form
    libnm's ip6-config::addr-gen-mode.
  - when NM creates a auto-default-connection for ethernet ("Wired connection 1"),
    it inherits the default from libnm's ip6-config::addr-gen-mode.

Global connection defaults only take effect when the per-profile
value is set to a special default/unset value. To account for the
different cases above, we add two such special values: "default" and
"default-or-eui64". That's something we didn't do before, but it seams
useful and easy to understand.

Also, this neatly expresses the current behaviors we already have. E.g.
if you don't specify the "addr-gen-mode" in a keyfile, "default-or-eui64"
is a pretty clear thing.

Note that usually we cannot change default values, in particular not for
libnm's properties. That is because we don't serialize the default
values to D-Bus/keyfile, so if we change the default, we change
behavior. Here we change from "stable-privacy" to "default" and
from "eui64" to "default-or-eui64". That means, the user only experiences
a change in behavior, if they have a ".conf" file that overrides the default.

https://bugzilla.redhat.com/show_bug.cgi?id=1743161
https://bugzilla.redhat.com/show_bug.cgi?id=2082682

See-also: https://github.com/coreos/fedora-coreos-tracker/issues/907

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1213
2022-06-29 07:38:48 +02:00
..
adsl format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
bluetooth settings: add "plugin" argument to AddAndActivate2() 2022-03-28 13:29:28 +02:00
ovs ovsdb: do not set the device as DEACTIVATING if it is DISCONNECTED 2022-05-25 15:51:43 +02:00
team team: specify cli-type for teamdctl_connect() to select usock/dbus 2022-06-27 14:04:40 +02:00
tests format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
wifi wifi: fix crash in NMDeviceWifi.check_connection_compatible() checking WEP capability 2022-06-02 13:25:10 +02:00
wwan all: use internal _nm_utils_ip4_netmask_to_prefix() 2022-06-27 10:50:24 +02:00
meson.build all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-6lowpan.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-device-6lowpan.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-bond.c bond: drop _get_option_or_default() and use _get_option_normalized() 2022-05-10 12:42:11 +02:00
nm-device-bond.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-bridge.c bridge: assume wired settings are there 2022-05-10 21:41:19 +02:00
nm-device-bridge.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-dummy.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-device-dummy.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-ethernet-utils.c all: add "src/core/nm-default-daemon.h" as replacement for "nm-default.h" 2021-02-09 12:38:18 +01:00
nm-device-ethernet-utils.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-ethernet.c device: drop unused variable and avoid compiler warning 2022-03-17 19:31:29 +01:00
nm-device-ethernet.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-factory.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-device-factory.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-device-generic.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-device-generic.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-infiniband.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-device-infiniband.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-ip-tunnel.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-device-ip-tunnel.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-logging.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-device-macsec.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-device-macsec.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-macvlan.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-device-macvlan.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-ppp.c ppp: don't remove addresses from interface while IPCP/IPV6CP is running 2022-06-14 12:26:21 +02:00
nm-device-ppp.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-private.h core/device: rename nm_device_master_release_one_slave() 2022-03-13 12:08:52 +01:00
nm-device-tun.c ovs, dpdk: ignore ovs-netdev tun interface 2022-03-31 11:49:34 +02:00
nm-device-tun.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-utils.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-device-utils.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-device-veth.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-device-veth.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-vlan.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-device-vlan.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-vrf.c device: make attach_port() asynchronous 2022-05-03 13:19:24 +02:00
nm-device-vrf.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-vxlan.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-device-vxlan.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-wireguard.c platform: rename "nmp-route-manager.h" to "nmp-rules-manager.h" 2022-02-09 19:13:03 +01:00
nm-device-wireguard.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-wpan.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-device-wpan.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device.c all: make "ipv6.addr-gen-mode" configurable by global default 2022-06-29 07:38:48 +02:00
nm-device.h device: make attach_port() asynchronous 2022-05-03 13:19:24 +02:00
nm-lldp-listener.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-lldp-listener.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00