network: do not remove reject type routes more than once
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 28 Apr 2021 17:42:42 +0000 (02:42 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 29 Apr 2021 00:11:36 +0000 (09:11 +0900)
commit8a9ce525d1d5830c074451dd2b62865958ac7308
tree8d8162001b46cf105e59bebb9b3e178d44244df9
parentc3fa1257da36522563c568524ba2a5113b1d90e9
network: do not remove reject type routes more than once

Usually, removing non-existing addresses, routes, and etc, are safe.
However, when multiple interfaces lost their carriers simultaneously,
then manager_drop_routes() and manager_drop_nexthop() are called multiple
times. If a route with a blackhole nexthop is removed in that process,
the later removal requests of the route fail with -EINVAL, rathar
than -ESRCH, as the corresponding nexthop does not exist anymore.

So, let's not remove routes which managed by Manager more than once.
src/network/networkd-route.c
src/network/networkd-route.h