NetworkManager/src/devices
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
..
adsl device: support reapplying route-table 2019-06-17 11:36:33 +02:00
bluetooth all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
ovs ovs/interface: actually allow dpdk type interfaces 2019-07-15 11:30:20 +02:00
team device: fix crash releasing destroyed slave 2019-07-02 17:52:53 +02:00
tests all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
wifi settings: cleanup handling of seen-bssids list in NMSettingsConnection 2019-06-28 16:48:17 +02:00
wwan device: support reapplying route-table 2019-06-17 11:36:33 +02:00
meson.build build: add initial support for meson build system 2017-12-13 15:48:50 +01:00
nm-acd-manager.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-acd-manager.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-6lowpan.c utils: add ifname argument to nm_utils_complete_generic() 2019-05-28 15:03:20 +02:00
nm-device-6lowpan.h devices: add NMDevice6Lowpan 2018-06-26 16:21:55 +02:00
nm-device-bond.c device: fix crash releasing destroyed slave 2019-07-02 17:52:53 +02:00
nm-device-bond.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-bridge.c device: fix crash releasing destroyed slave 2019-07-02 17:52:53 +02:00
nm-device-bridge.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-dummy.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-dummy.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-ethernet-utils.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-ethernet-utils.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-ethernet.c device: support reapplying route-table 2019-06-17 11:36:33 +02:00
nm-device-ethernet.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-factory.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-factory.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-generic.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-generic.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-infiniband.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-infiniband.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-ip-tunnel.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-ip-tunnel.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-logging.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-macsec.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-macsec.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-macvlan.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-macvlan.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-ppp.c device: ppp: check that connection has a PPPoE parent 2019-07-03 17:56:37 +02:00
nm-device-ppp.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-private.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-tun.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-tun.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-veth.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-veth.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-vlan.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-vlan.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-vxlan.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-vxlan.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-device-wireguard.c device: support reapplying route-table 2019-06-17 11:36:33 +02:00
nm-device-wireguard.h core: introduce NMDeviceWireGuard 2018-08-06 08:34:27 +02:00
nm-device-wpan.c utils: add ifname argument to nm_utils_complete_generic() 2019-05-28 15:03:20 +02:00
nm-device-wpan.h devices: add NMDeviceWpan 2018-06-26 16:21:54 +02:00
nm-device.c policy-routing: take ownership of externally configured rules 2019-07-16 10:16:07 +02:00
nm-device.h device: support reapplying route-table 2019-06-17 11:36:33 +02:00
nm-lldp-listener.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-lldp-listener.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00