NetworkManager/src/libnm-core-public
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
..
meson.build bond: add support of queue_id of bond port 2021-08-26 23:04:31 +02:00
nm-connection.h all: adjust glib-mkenums annotations for automated formatting 2022-02-08 11:14:01 +01:00
nm-core-types.h bond: add support of queue_id of bond port 2021-08-26 23:04:31 +02:00
nm-dbus-interface.h core: export radio flags 2022-03-29 09:34:07 +02:00
nm-errors.h build: move "libnm-core/" to "src/" and split it 2021-02-18 19:46:51 +01:00
nm-keyfile.h all: adjust glib-mkenums annotations for automated formatting 2022-02-08 11:14:01 +01:00
nm-setting-6lowpan.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-8021x.h wifi: support "802-1x.phase1-auth-flags=tls-allow-unsafe-renegotiation" flag 2022-05-16 12:09:11 +02:00
nm-setting-adsl.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-bluetooth.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-bond-port.h bond: add support of queue_id of bond port 2021-08-26 23:04:31 +02:00
nm-setting-bond.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-bridge-port.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-bridge.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-cdma.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-connection.h libnm: support wait-activation-delay property 2022-06-16 02:14:21 +02:00
nm-setting-dcb.h all: adjust glib-mkenums annotations for automated formatting 2022-02-08 11:14:01 +01:00
nm-setting-dummy.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-ethtool.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-generic.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-gsm.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-hostname.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-infiniband.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-ip-config.h libnm,core: add support for {rto_min,quickack,advmss} route attributes 2022-06-27 11:38:43 +02:00
nm-setting-ip-tunnel.h all: adjust glib-mkenums annotations for automated formatting 2022-02-08 11:14:01 +01:00
nm-setting-ip4-config.h settings: add ipv4.link-local flag 2022-05-27 08:24:28 +02:00
nm-setting-ip6-config.h all: make "ipv6.addr-gen-mode" configurable by global default 2022-06-29 07:38:48 +02:00
nm-setting-macsec.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-macvlan.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-match.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-olpc-mesh.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-ovs-bridge.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-ovs-dpdk.h openvswitch: Add ovs-dpdk n_rxq property 2022-01-10 22:48:30 +00:00
nm-setting-ovs-external-ids.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-ovs-interface.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-ovs-patch.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-ovs-port.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-ppp.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-pppoe.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-proxy.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-serial.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-sriov.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-tc-config.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-team-port.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-team.h all: adjust glib-mkenums annotations for automated formatting 2022-02-08 11:14:01 +01:00
nm-setting-tun.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-user.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-veth.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-vlan.h libnm: drop unnecessary /*clang-format off*/ 2022-02-08 11:14:01 +01:00
nm-setting-vpn.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-vrf.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-vxlan.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-wifi-p2p.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-wimax.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting-wired.h all: adjust glib-mkenums annotations for automated formatting 2022-02-08 11:14:01 +01:00
nm-setting-wireguard.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-setting-wireless-security.h all: adjust glib-mkenums annotations for automated formatting 2022-02-08 11:14:01 +01:00
nm-setting-wireless.h all: adjust glib-mkenums annotations for automated formatting 2022-02-08 11:14:01 +01:00
nm-setting-wpan.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-setting.h all: adjust glib-mkenums annotations for automated formatting 2022-02-08 11:14:01 +01:00
nm-simple-connection.h clang-format: use "IndentPPDirectives:None" instead of "BeforeHash" 2021-07-09 08:49:06 +02:00
nm-utils.h libnm: move dependency to libnm-crypto out of libnm-core's "nm-utils.c" 2022-03-29 11:56:04 +02:00
nm-version-macros.h.in version: add 1.40 macros 2022-05-01 14:12:20 +02:00
nm-version.h version: add 1.40 macros 2022-05-01 14:12:20 +02:00
nm-vpn-dbus-interface.h libnm: allow manually specified IP addresses to have prefix length 0 2022-05-26 19:08:28 +02:00
nm-vpn-editor-plugin.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-vpn-plugin-info.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
README.md build: move "libnm-core/" to "src/" and split it 2021-02-18 19:46:51 +01:00

libnm-core-public

This contains (mostly) header files only, which are also part of the public API of libnm.

Also, this API is implemented by the static library libnm-core-impl, which in turn is statically linked into NetworkManager core and libnm.

These headers can be used by anybody who either:

Note that there is also one source file: nm-core-enum-types.c. This source file really belongs to libnm-core-impl but it is here because it's a generated file and so far I couldn't figure out how to generate nm-core-enum-types.h here while moving nm-core-enum-types.c to libnm-core-impl.

Aside nm-core-enum-types.c, this directory only provides header files. Users should add this directory (both srcdir and builddir) to the include search path, because libnm users are used to include these headers unqualified (like #include "nm-setting.h).