Go to file
Thomas Haller 4a548423b9
core: change order/priority of static IPv6 addresses relative to autoconf6/DHCPv6
The order of addresses can matter for source address selection.
This is described in RFC 6724 section 5, but if the rules don't
determine a clear winner, the order matters.

Change the relative order of IPv6 addresses. Previously, we would prefer
autoconf6, over DHCPv6, over manual addresses. Now that got reverted
to make more sense and be consistent with IPv4.
Also, if we had multiple autoconf6 addresses (received at different
moments in time), then previously a newly received address would be
added with highest priority. Now, the older address will be preferred
and that order will be enforced (this can be a problem, see (*) below).

For IPv4, it's all simple and sensible. When we add addresses in kernel
via netlink, the first address (of a subnet) becomes the primary.
Note that we only control the order of addresses of the same subnet.
The addresses in ipv4.addresses" are sorted with primary address first.
In the same way is the order for addresses in NML3ConfigData and for
@known_addresses in nm_platform_ip_address_sync(), all primary-first.
Also, manual addresses are sorted with higher priority compared to DHCPv4
addresses (at least since NetworkManager 1.36). That means the way how we
merge NML3ConfigData makes sense (nm_l3_config_data_merge()) because we first
merge the static configuration, then the DHCPv4 configuration, where we just
append the lower priority DHCPv4 addresses.

For IPv6, the address priority is messed up. On netlink/kernel, the last added
address becomes the preferred one (we thus need to add them in the order of
lowest priority first). Consequently and historically, the IPv6 addresses in
@known_addresses parameter to nm_platform_ip_address_sync() were
lowest priority first. And so they were tracked in NML3ConfigData
and in the profile ("ipv6.addresses"). That is confusing.
Also, we usually want to merge NML3ConfigData with different priorities
(e.g. static configuration from the profile before autoconf6/DHCPv6),
as we do with IPv4. However, since internally IPv6 addresses are tracked in
reverse order, it means later NML3ConfigData would be appended and get effectively
a higher priority. That means, autoconf6 addresses were preferred over DHCPv6 and
over manual "ipv6.addresses", respectively. That seems undesirable and inconsistent
with IPv4. Change that. This is a change in behavior.

Note that changing the order of addresses means to remove and re-add
them in the right (inverse) order, with lease important first. This
means, when we add a new address with lower priority, we need to remove
all higher priority addresses temporarily, before readding them. That
is a problem(*).

Note that in the profile, "ipv6.addresses" is still tracked in reverse
order. This did not change, but might change later.
2022-04-27 15:50:50 +02:00
.gitlab-ci gitlab-ci: use "nm-python-black-format.sh" script on "check-tree" 2022-04-01 14:02:23 +02:00
contrib contrib: install nmstate+nispor in "nm-in-container.sh" 2022-04-19 11:15:08 +02:00
data udev: manage veths named eth* 2022-02-23 09:35:15 +01:00
docs docs: add "sandboxing.md" 2022-03-28 18:04:18 +02:00
examples examples: add "--last" argument to "examples/python/gi/checkpoint.py" 2022-02-23 17:07:16 +01:00
introspection core: export radio flags 2022-03-29 09:34:07 +02:00
m4 build: rework libreadline detection in autotools 2021-07-19 09:08:06 +02:00
man nmcli: add --offline option for "add" and "modify" 2022-04-19 14:12:42 +02:00
po po: update Ukrainian (uk) translation 2022-04-26 08:29:11 +02:00
src core: change order/priority of static IPv6 addresses relative to autoconf6/DHCPv6 2022-04-27 15:50:50 +02:00
tools libnm/docs: fix documentation for "proxy.pac-script" 2022-03-21 15:21:37 +01:00
vapi vapi: annotate finish function for DeviceWifi.request_scan_options_async 2022-02-21 19:42:58 +01:00
.clang-format clang-format: mark FOR_EACH_DELAYED_ACTION() as a ForEachMacro 2022-01-13 15:25:17 +01:00
.dir-locals.el misc: add toplevel .dir-locals file that tells Emacs to show trailing whitespace 2013-03-08 15:15:28 +01:00
.git-blame-ignore-revs format: add ".git-blame-ignore-revs" and hint how to ignore the commit during git-blame 2020-10-27 16:00:45 +01:00
.gitignore priv-helper: fix D-Bus patch to not contain forbidden character '-' 2022-02-09 18:49:47 +01:00
.gitlab-ci.yml gitlab-ci: use "nm-python-black-format.sh" script on "check-tree" 2022-04-01 14:02:23 +02:00
.lgtm.yml lgtm.com: add configuration file for building on lgtm.com 2021-05-26 19:25:42 +02:00
.mailmap mailmap: update to add Ana 2021-07-08 22:57:45 +02:00
.triage-policies.yml gitlab-ci: use ruby:2.7 for triage pipeline 2020-03-18 17:40:59 +01:00
AUTHORS misc: update maintainers and authors 2016-04-21 13:39:03 -05:00
autogen.sh all: move "src/" directory to "src/core/" 2021-02-04 09:45:55 +01:00
ChangeLog Changelog: update references to "main" branch 2021-04-01 22:30:20 +02:00
config-extra.h.meson build: remove duplicate and unused RUNDIR define 2019-05-17 21:24:18 +02:00
config-extra.h.mk build: regenerate config-extra.h if configure was re-run with different arguments 2019-09-25 15:55:37 +02:00
config.h.meson dns/unbound: drop deprecated "unbound" DNS plugin 2022-04-15 09:04:30 +02:00
configure.ac configure.ac: fix a syntax error 2022-04-21 09:57:48 +02:00
CONTRIBUTING.md CONTRIBUTING: document style guide about naming in header files 2022-01-20 08:14:48 +01:00
COPYING COPYING: make sure we ship the relevant license texts 2019-09-10 11:10:52 +02:00
COPYING.GFDL COPYING: make sure we ship the relevant license texts 2019-09-10 11:10:52 +02:00
COPYING.LGPL COPYING: make sure we ship the relevant license texts 2019-09-10 11:10:52 +02:00
linker-script-binary.ver iface-helper/build: add linker version script 2016-10-13 21:33:33 +02:00
linker-script-devices.ver devices/build: use one linker-script-devices.ver for all device plugins 2016-10-13 21:36:06 +02:00
linker-script-settings.ver settings/build: add linker version script for settings plugins 2016-10-13 21:33:33 +02:00
lsan.suppressions tests/sanitizer: suppress leak in openssl 2020-05-14 12:03:24 +02:00
MAINTAINERS misc: update maintainers and authors 2016-04-21 13:39:03 -05:00
MAINTAINERS.md MAINTAINERS: add backports section 2021-10-14 15:40:20 +02:00
Makefile.am systemd: drop "nm-sd-utils-core.h" and nm_sd_utils_id128_get_machine() 2022-04-20 12:07:04 +02:00
Makefile.examples examples: add "examples/python/gi/nm-up-many.py" 2021-06-11 22:48:41 +02:00
Makefile.glib all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
Makefile.vapigen build: fix make always re-making vapigen target 2016-10-21 18:46:03 +02:00
meson.build release: bump version to 1.39.2 (development) 2022-04-20 17:48:34 +02:00
meson_options.txt dns/unbound: drop deprecated "unbound" DNS plugin 2022-04-15 09:04:30 +02:00
NEWS core: change order/priority of static IPv6 addresses relative to autoconf6/DHCPv6 2022-04-27 15:50:50 +02:00
README.md Squashed 'src/c-stdaux/' changes from 8652c488b8f1..9582a563c25e 2022-04-13 11:01:09 +02:00
RELICENSE.md license: add Daniel to RELICENSE.md 2020-09-24 09:35:00 +02:00
TODO core/trivial: rename NM_SHUTDOWN_TIMEOUT_MS to NM_SHUTDOWN_TIMEOUT_MAX_MSEC 2022-02-24 09:38:52 +01:00
valgrind.suppressions all: goodbye libnm-glib 2019-04-16 15:52:27 +02:00


NetworkManager core daemon has moved to gitlab.freedesktop.org!

git clone https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git


Networking that Just Works

NetworkManager attempts to keep an active network connection available at all times. The point of NetworkManager is to make networking configuration and setup as painless and automatic as possible. NetworkManager is intended to replace default route, replace other routes, set IP addresses, and in general configure networking as NM sees fit (with the possibility of manual override as necessary). In effect, the goal of NetworkManager is to make networking Just Work with a minimum of user hassle, but still allow customization and a high level of manual network control. If you have special needs, we'd like to hear about them, but understand that NetworkManager is not intended for every use-case.

NetworkManager will attempt to keep every network device in the system up and active, as long as the device is available for use (has a cable plugged in, the killswitch isn't turned on, etc). Network connections can be set to 'autoconnect', meaning that NetworkManager will make that connection active whenever it and the hardware is available.

"Settings services" store lists of user- or administrator-defined "connections", which contain all the settings and parameters required to connect to a specific network. NetworkManager will never activate a connection that is not in this list, or that the user has not directed NetworkManager to connect to.

How it works:

The NetworkManager daemon runs as a privileged service (since it must access and control hardware), but provides a D-Bus interface on the system bus to allow for fine-grained control of networking. NetworkManager does not store connections or settings, it is only the mechanism by which those connections are selected and activated.

To store pre-defined network connections, two separate services, the "system settings service" and the "user settings service" store connection information and provide these to NetworkManager, also via D-Bus. Each settings service can determine how and where it persistently stores the connection information; for example, the GNOME applet stores its configuration in GConf, and the system settings service stores its config in distro-specific formats, or in a distro- agnostic format, depending on user/administrator preference.

A variety of other system services are used by NetworkManager to provide network functionality: wpa_supplicant for wireless connections and 802.1x wired connections, pppd for PPP and mobile broadband connections, DHCP clients for dynamic IP addressing, dnsmasq for proxy nameserver and DHCP server functionality for internet connection sharing, and avahi-autoipd for IPv4 link-local addresses. Most communication with these daemons occurs, again, via D-Bus.

Why doesn't my network Just Work?

Driver problems are the #1 cause of why NetworkManager sometimes fails to connect to wireless networks. Often, the driver simply doesn't behave in a consistent manner, or is just plain buggy. NetworkManager supports only those drivers that are shipped with the upstream Linux kernel, because only those drivers can be easily fixed and debugged. ndiswrapper, vendor binary drivers, or other out-of-tree drivers may or may not work well with NetworkManager, precisely because they have not been vetted and improved by the open-source community, and because problems in these drivers usually cannot be fixed.

Sometimes, command-line tools like 'iwconfig' will work, but NetworkManager will fail. This is again often due to buggy drivers, because these drivers simply aren't expecting the dynamic requests that NetworkManager and wpa_supplicant make. Driver bugs should be filed in the bug tracker of the distribution being run, since often distributions customize their kernel and drivers.

Sometimes, it really is NetworkManager's fault. If you think that's the case, please file a bug at:

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues

Attaching NetworkManager debug logs from the journal (or wherever your distribution directs syslog's 'daemon' facility output, as /var/log/messages or /var/log/daemon.log) is often very helpful, and (if you can get) a working wpa_supplicant config file helps enormously. See the logging section of file contrib/fedora/rpm/NetworkManager.conf for how to enable debug logging in NetworkManager.