NetworkManager/src
Thomas Haller 15b1304477 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.
2019-07-16 10:16:07 +02:00
..
devices policy-routing: take ownership of externally configured rules 2019-07-16 10:16:07 +02:00
dhcp dhcp-listener: keep reference to NMDBusManager singleton 2019-07-15 12:45:38 +02:00
dns all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
dnsmasq all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
initrd initrd/tests: add some more variations of possible BOOTIF= variables 2019-07-03 09:16:52 +02:00
ndisc all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
platform policy-routing: take ownership of externally configured rules 2019-07-16 10:16:07 +02:00
ppp core/pppd-plugin: wait to recover port settings before notifying death 2019-06-14 13:29:45 +02:00
settings libnm,cli,ifcfg-rh: add connection:wait-device-timeout property 2019-07-10 12:43:06 +02:00
supplicant all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
systemd dhcp: access internal systemd structure to retrieve dhcp private options 2019-07-05 14:12:21 +02:00
tests src/tests: show exit status in test failure of test_nm_utils_kill_child() 2019-06-13 11:27:32 +02:00
vpn all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
main-utils.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
main-utils.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
main.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
meson.build dhcp/internal: move dhcp options management to shared dhcp codebase 2019-07-05 15:13:09 +02:00
NetworkManagerUtils.c libnm,core: add support for "suppress_prefixlength" rule attribute 2019-07-16 10:03:17 +02:00
NetworkManagerUtils.h core: add flag to nm_shutdown_wait_obj_register_full() for freeing allcated message string 2019-06-26 12:26:11 +02:00
nm-act-request.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-act-request.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-active-connection.c core: add and use nm_keep_alive_destroy() 2019-06-27 13:25:40 +02:00
nm-active-connection.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-audit-manager.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-audit-manager.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-auth-manager.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-auth-manager.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-auth-subject.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-auth-subject.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-auth-utils.c auth-chain: track auth-chains in embedded CList 2019-06-13 16:10:53 +02:00
nm-auth-utils.h auth-chain: track auth-chains in embedded CList 2019-06-13 16:10:53 +02:00
nm-checkpoint-manager.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-checkpoint-manager.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-checkpoint.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-checkpoint.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-config-data.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-config-data.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-config.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-config.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-connectivity.c connectivity: make platform argument to nm_connectivity_check_start() optional 2019-06-18 15:49:09 +02:00
nm-connectivity.h device: don't start connectivity check on unconfigured devices 2019-06-18 15:49:09 +02:00
nm-core-utils.c settings: don't implement settings plugins as singletons 2019-06-26 12:26:11 +02:00
nm-core-utils.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-dbus-manager.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-dbus-manager.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-dbus-object.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-dbus-object.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-dbus-utils.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-dbus-utils.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-dcb.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-dcb.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-dhcp4-config.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-dhcp4-config.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-dhcp6-config.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-dhcp6-config.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-dispatcher.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-dispatcher.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-firewall-manager.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-firewall-manager.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-hostname-manager.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-hostname-manager.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-iface-helper.c dhcp: pass broadcast address to clients 2019-07-05 11:06:01 +02:00
nm-ip4-config.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-ip4-config.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-ip6-config.c core: fix mangling static IPv6 routes in nm_ip6_config_merge_setting() 2019-07-09 14:33:57 +02:00
nm-ip6-config.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-keep-alive.c core: add and use nm_keep_alive_destroy() 2019-06-27 13:25:40 +02:00
nm-keep-alive.h core: add and use nm_keep_alive_destroy() 2019-06-27 13:25:40 +02:00
nm-logging.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-logging.h core: avoid plain pointer values in logging output 2019-06-25 13:26:37 +02:00
nm-manager.c core: use nm_c_list_elem_free_steal() in _delete_volatile_connection_all () 2019-07-10 12:43:06 +02:00
nm-manager.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-netns.c policy-routing: take ownership of externally configured rules 2019-07-16 10:16:07 +02:00
nm-netns.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-pacrunner-manager.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-pacrunner-manager.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-policy.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-policy.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-proxy-config.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-proxy-config.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-rfkill-manager.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-rfkill-manager.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-session-monitor.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-session-monitor.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-sleep-monitor.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-sleep-monitor.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-test-utils-core.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-types.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
org.freedesktop.NetworkManager.conf wifi-p2p: rename Wi-Fi P2P 2019-02-01 17:02:57 +01:00