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
the entires should be managed, deleted and modified by NetworkManager.

Routing policy rules are global. For that we have NMPRulesManager which
keeps track of who owns a rule. This allows multiple connection profiles
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, but that
is currently not used. All that devices do is to add rules (track) 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 priority to avoid such conflict altogether.
17 jobs for th/routing-rule-suppress-prefixlength in 128 minutes and 59 seconds (queued for 1 minute and 25 seconds)
Status Job ID Name Coverage
  Test
passed #421670
allowed to fail
checkpatch

00:01:14

manual #421675
allowed to fail manual
t_centos:7.5.1804
passed #421676
t_centos:7.6.1810

00:24:20

passed #421682
t_debian:10

00:12:23

passed #421681
t_debian:9

00:23:06

passed #421684
t_debian:sid

00:12:53

manual #421683
allowed to fail manual
t_debian:testing
passed #421671
t_fedora:28

00:27:30

passed #421672
t_fedora:29

00:33:15

passed #421673
t_fedora:30

00:26:32

manual #421674
allowed to fail manual
t_fedora:rawhide
passed #421677
t_ubuntu:16.04

00:25:37

passed #421678
t_ubuntu:18.04

00:13:22

manual #421680
allowed to fail manual
t_ubuntu:devel
manual #421679
allowed to fail manual
t_ubuntu:rolling
 
  External
passed NetworkManager test verification

passed NetworkManager test verification

05:59:53