NetworkManager/src
Thomas Haller a3e51a74aa policy-routing: take ownership of externally configured rules
IP addresses, routes, TC and QDiscs are all tied to a certain interface.
So when NetworkManager manages an interface, it can be confident that
all related entires should be managed, deleted and modified by NetworkManager.

Routing policy rules are global. For that we have NMPRulesManager which
keeps track of whether NetworkManager owns a rule. This allows multiple
connection profiles to specify the same rule, and NMPRulesManager can
consolidate this information to know whether to add or remove the rule.

NMPRulesManager would also support to explicitly block a rule by
tracking it with negative priority. However that is still unused at
the moment. All that devices do is to add rules (track with positive
priority) and remove them (untrack) once the profile gets deactivated.

As rules are not exclusively owned by NetworkManager, NetworkManager
tries not to interfere with rules that it knows nothing about. That
means in particular, when NetworkManager starts it will "weakly track"
all rules that are present. "weakly track" is mostly interesting for two
cases:

  - when NMPRulesManager had the same rule explicitly tracked (added) by a
    device, then deactivating the device will leave the rule in place.

  - when NMPRulesManager had the same rule explicitly blocked (tracked
    with negative priority), then it would restore the rule when that
    block gets removed (as said, currently nobody actually does this).

Note that when restarting NetworkManager, then the device may stay and
the rules kept. However after restart, NetworkManager no longer knows
that it previously added this route, so it would weakly track it and
never remove them again.

That is a problem. Avoid that, by whenever explicitly tracking a rule we
also make sure to no longer weakly track it. Most likely this rule was
indeed previously managed by NetworkManager. If this was really a rule
added by externally, then the user really should choose distinct
rule priorities to avoid such conflicts altogether.

(cherry picked from commit 15b1304477)
2019-07-25 10:29:16 +02:00
..
devices policy-routing: take ownership of externally configured rules 2019-07-25 10:29:16 +02:00
dhcp build/meson: rename "nm_core_dep" to "libnm_core_dep" 2019-04-18 20:13:49 +02:00
dns shared: move "nm-dbus-compat.h" header to "nm-std-aux/nm-dbus-compat.h" 2019-04-18 20:03:54 +02:00
dnsmasq all: drop unnecessary includes of <errno.h> and <string.h> 2019-02-12 08:50:28 +01:00
initrd initrd/tests: add some more variations of possible BOOTIF= variables 2019-07-24 08:45:38 +02:00
ndisc build/meson: increase timeouts for some tests 2019-02-23 07:20:49 +01:00
platform policy-routing: take ownership of externally configured rules 2019-07-25 10:29:16 +02:00
ppp core/pppd-plugin: wait to recover port settings before notifying death 2019-06-14 13:32:57 +02:00
settings ifcfg-rh: fix memory leak reading infiniband setting 2019-07-04 11:55:20 +02:00
supplicant shared: move "nm-dbus-compat.h" header to "nm-std-aux/nm-dbus-compat.h" 2019-04-18 20:03:54 +02:00
systemd build/meson: rename "nm_core_dep" to "libnm_core_dep" 2019-04-18 20:13:49 +02:00
tests build/meson: rename "nm_core_dep" to "libnm_core_dep" 2019-04-18 20:13:49 +02:00
vpn core: use nm_connection_get_setting_ip_config() helper 2019-03-05 09:53:21 +01:00
main-utils.c all: replace strerror() calls with nm_strerror_native() 2019-02-12 08:50:28 +01:00
main-utils.h
main.c all: replace g_strerror() calls with nm_strerror_native() 2019-02-12 08:50:28 +01:00
meson.build build/meson: rename "nm_core_dep" to "libnm_core_dep" 2019-04-18 20:13:49 +02:00
NetworkManagerUtils.c shared: build helper "libnm-libnm-core-{intern|aux}.la" library for libnm-core 2019-04-18 20:07:44 +02:00
NetworkManagerUtils.h core: add handling of IP routing rules to NMDevice 2019-03-27 16:23:30 +01:00
nm-act-request.c all: drop unnecessary includes of <errno.h> and <string.h> 2019-02-12 08:50:28 +01:00
nm-act-request.h core: pass hints as strv to nm_act_request_get_secrets() 2019-02-05 08:34:23 +01:00
nm-active-connection.c shared: build helper "libnm-libnm-core-{intern|aux}.la" library for libnm-core 2019-04-18 20:07:44 +02:00
nm-active-connection.h core: improve and fix keeping connection active based on "connection.permissions" 2018-12-09 14:47:32 +01:00
nm-audit-manager.c all: replace strerror() calls with nm_strerror_native() 2019-02-12 08:50:28 +01:00
nm-audit-manager.h checkpoint: allow resetting the rollback timeout via D-Bus 2018-04-04 14:02:13 +02:00
nm-auth-manager.c auth-manager: use the correct function to deallocate a GError 2018-05-02 14:55:01 +02:00
nm-auth-manager.h auth-manager: add helper function nm_auth_call_result_eval() 2018-04-13 09:09:46 +02:00
nm-auth-subject.c dbus: cache GetConnectionUnixProcessID and GetConnectionUnixUser 2019-04-09 20:40:18 +02:00
nm-auth-subject.h all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-auth-utils.c shared: move most of "shared/nm-utils" to "shared/nm-glib-aux" 2019-04-18 19:57:27 +02:00
nm-auth-utils.h core: add nm_auth_is_subject_in_acl_set_error() helper 2018-04-18 07:55:15 +02:00
nm-checkpoint-manager.c settings: use delegation instead of inheritance for NMSettingsConnection and NMConnection 2018-08-28 22:27:55 +02:00
nm-checkpoint-manager.h checkpoint: allow resetting the rollback timeout via D-Bus 2018-04-04 14:02:13 +02:00
nm-checkpoint.c checkpoint: hold a reference to the NMManager object 2019-04-10 10:43:09 +02:00
nm-checkpoint.h checkpoint: allow resetting the rollback timeout via D-Bus 2018-04-04 14:02:13 +02:00
nm-config-data.c all: cache errno in local variable before using it 2019-02-12 08:50:28 +01:00
nm-config-data.h core: add checks on connection default properties 2018-12-01 15:16:48 +01:00
nm-config.c all: drop unnecessary includes of <errno.h> and <string.h> 2019-02-12 08:50:28 +01:00
nm-config.h build: check that the list of supported config options is up to date 2018-12-01 15:16:48 +01:00
nm-connectivity.c connectivity: make platform argument to nm_connectivity_check_start() optional 2019-06-20 10:28:26 +02:00
nm-connectivity.h device: don't start connectivity check on unconfigured devices 2019-06-20 10:28:21 +02:00
nm-core-utils.c core: fix file permissions for "/var/lib/NetworkManager/secret_key" 2019-05-14 14:04:17 +02:00
nm-core-utils.h shared: move most of "shared/nm-utils" to "shared/nm-glib-aux" 2019-04-18 19:57:27 +02:00
nm-dbus-manager.c shared: move "nm-dbus-compat.h" header to "nm-std-aux/nm-dbus-compat.h" 2019-04-18 20:03:54 +02:00
nm-dbus-manager.h dbus: cache GetConnectionUnixProcessID and GetConnectionUnixUser 2019-04-09 20:40:18 +02:00
nm-dbus-object.c core/dbus: stop NMDBusManager and reject future method calls 2018-04-24 10:25:26 +02:00
nm-dbus-object.h core/dbus: stop NMDBusManager and reject future method calls 2018-04-24 10:25:26 +02:00
nm-dbus-utils.c dbus-utils: don't return paths if they are in the process of being unexported 2019-03-22 16:14:12 +01:00
nm-dbus-utils.h core/dbus: stop NMDBusManager and reject future method calls 2018-04-24 10:25:26 +02:00
nm-dcb.c dcb: fix invalid assertion in dcb's do_helper() 2019-04-16 15:30:14 +02:00
nm-dcb.h
nm-dhcp4-config.c all: drop unnecessary includes of <errno.h> and <string.h> 2019-02-12 08:50:28 +01:00
nm-dhcp4-config.h
nm-dhcp6-config.c all: drop unnecessary includes of <errno.h> and <string.h> 2019-02-12 08:50:28 +01:00
nm-dhcp6-config.h
nm-dispatcher.c shared: build helper "libnm-libnm-core-{intern|aux}.la" library for libnm-core 2019-04-18 20:07:44 +02:00
nm-dispatcher.h all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
nm-firewall-manager.c all: drop unnecessary includes of <errno.h> and <string.h> 2019-02-12 08:50:28 +01:00
nm-firewall-manager.h firewall: merge "started" signal and "available" property 2017-04-21 09:09:01 +02:00
nm-hostname-manager.c hostname-manager: use fqdn for persistent hostname on Slackware 2019-05-19 10:48:09 +02:00
nm-hostname-manager.h hostname: cache hostname-manager's hostname property 2017-05-12 17:29:33 +02:00
nm-iface-helper.c shared: move most of "shared/nm-utils" to "shared/nm-glib-aux" 2019-04-18 19:57:27 +02:00
nm-ip4-config.c shared: move most of "shared/nm-utils" to "shared/nm-glib-aux" 2019-04-18 19:57:27 +02:00
nm-ip4-config.h shared: move most of "shared/nm-utils" to "shared/nm-glib-aux" 2019-04-18 19:57:27 +02:00
nm-ip6-config.c core: fix mangling static IPv6 routes in nm_ip6_config_merge_setting() 2019-07-09 14:35:05 +02:00
nm-ip6-config.h shared: move most of "shared/nm-utils" to "shared/nm-glib-aux" 2019-04-18 19:57:27 +02:00
nm-keep-alive.c all: drop unnecessary includes of <errno.h> and <string.h> 2019-02-12 08:50:28 +01:00
nm-keep-alive.h keep-alive: drop unused nm_keep_alive_set_forced() 2018-12-09 14:47:31 +01:00
nm-logging.c shared: move most of "shared/nm-utils" to "shared/nm-glib-aux" 2019-04-18 19:57:27 +02:00
nm-logging.h shared: move most of "shared/nm-utils" to "shared/nm-glib-aux" 2019-04-18 19:57:27 +02:00
nm-manager.c manager: relax condition when checking for duplicate ACs 2019-05-20 14:55:52 +02:00
nm-manager.h core: improve and fix keeping connection active based on "connection.permissions" 2018-12-09 14:47:32 +01:00
nm-netns.c policy-routing: take ownership of externally configured rules 2019-07-25 10:29:16 +02:00
nm-netns.h platform: add NMPRulesManager for syncing routing rules 2019-03-13 09:47:37 +01:00
nm-pacrunner-manager.c all: don't use static buffer for nm_utils_inet*_ntop() 2018-12-19 09:23:08 +01:00
nm-pacrunner-manager.h proxy: introduce call-id for clearing pacmanager configuration 2017-04-23 18:12:09 +02:00
nm-policy.c policy: fix memory leak 2019-04-12 11:19:58 +02:00
nm-policy.h policy: track best active connections rather than best devices 2018-07-09 14:56:59 +02:00
nm-proxy-config.c
nm-proxy-config.h
nm-rfkill-manager.c shared: move udev helper to separate directory "shared/nm-udev-aux" 2019-04-18 19:46:50 +02:00
nm-rfkill-manager.h
nm-session-monitor.c all: replace strerror() calls with nm_strerror_native() 2019-02-12 08:50:28 +01:00
nm-session-monitor.h
nm-sleep-monitor.c all: drop unnecessary includes of <errno.h> and <string.h> 2019-02-12 08:50:28 +01:00
nm-sleep-monitor.h
nm-test-utils-core.h shared: move most of "shared/nm-utils" to "shared/nm-glib-aux" 2019-04-18 19:57:27 +02:00
nm-types.h platform: add support for routing-rule objects and cache them in platform 2019-03-13 09:03:59 +01:00
org.freedesktop.NetworkManager.conf wifi-p2p: rename Wi-Fi P2P 2019-02-01 17:02:57 +01:00