diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-12-11 14:39:46 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-12-11 14:39:46 +0900 |
commit | bd4733da646edbec64251cf72d83c1a9a2588433 (patch) | |
tree | 86ee32afd0470404bf1255a4eebe19f5d6290835 | |
parent | b788a429d19acda8acb1c4b543da1adc2e49f4a9 (diff) | |
download | systemd-bd4733da646edbec64251cf72d83c1a9a2588433.tar.gz |
network: do not configure static configs more than once simultaneously
-rw-r--r-- | src/network/networkd-address.c | 5 | ||||
-rw-r--r-- | src/network/networkd-mdb.c | 5 | ||||
-rw-r--r-- | src/network/networkd-neighbor.c | 5 | ||||
-rw-r--r-- | src/network/networkd-nexthop.c | 5 | ||||
-rw-r--r-- | src/network/networkd-route.c | 5 | ||||
-rw-r--r-- | src/network/networkd-routing-policy-rule.c | 5 | ||||
-rw-r--r-- | src/network/networkd-sriov.c | 9 | ||||
-rw-r--r-- | src/network/tc/tc.c | 9 |
8 files changed, 46 insertions, 2 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index 82daa1135e..9e98b77720 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -1004,6 +1004,11 @@ int link_set_addresses(Link *link) { return 0; } + if (link->address_messages != 0) { + log_link_debug(link, "Static addresses are configuring."); + return 0; + } + ORDERED_HASHMAP_FOREACH(ad, link->network->addresses_by_section) { bool update; diff --git a/src/network/networkd-mdb.c b/src/network/networkd-mdb.c index 0300dced62..7007a8202d 100644 --- a/src/network/networkd-mdb.c +++ b/src/network/networkd-mdb.c @@ -199,6 +199,11 @@ int link_set_bridge_mdb(Link *link) { assert(link); assert(link->manager); + if (link->bridge_mdb_messages != 0) { + log_link_debug(link, "MDB entries are configuring."); + return 0; + } + link->bridge_mdb_configured = false; if (!link->network) diff --git a/src/network/networkd-neighbor.c b/src/network/networkd-neighbor.c index c805d52cf3..847ecd27c3 100644 --- a/src/network/networkd-neighbor.c +++ b/src/network/networkd-neighbor.c @@ -294,6 +294,11 @@ int link_set_neighbors(Link *link) { assert(link->network); assert(link->state != _LINK_STATE_INVALID); + if (link->neighbor_messages != 0) { + log_link_debug(link, "Neighbors are configuring."); + return 0; + } + link->neighbors_configured = false; HASHMAP_FOREACH(neighbor, link->network->neighbors_by_section) { diff --git a/src/network/networkd-nexthop.c b/src/network/networkd-nexthop.c index 4a09b4c912..13f532763d 100644 --- a/src/network/networkd-nexthop.c +++ b/src/network/networkd-nexthop.c @@ -312,6 +312,11 @@ int link_set_nexthop(Link *link) { assert(link); assert(link->network); + if (link->nexthop_messages != 0) { + log_link_debug(link, "Nexthops are configuring."); + return 0; + } + link->static_nexthops_configured = false; HASHMAP_FOREACH(nh, link->network->nexthops_by_section) { diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index de7c232f15..ccacfacf3d 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -1237,6 +1237,11 @@ int link_set_routes(Link *link) { * the addresses now, let's not configure the routes either. */ return 0; + if (link->route_messages != 0) { + log_link_debug(link, "Static routes are configuring."); + return 0; + } + r = link_set_routing_policy_rules(link); if (r < 0) return r; diff --git a/src/network/networkd-routing-policy-rule.c b/src/network/networkd-routing-policy-rule.c index a31fb31fa4..06c597d147 100644 --- a/src/network/networkd-routing-policy-rule.c +++ b/src/network/networkd-routing-policy-rule.c @@ -663,6 +663,11 @@ int link_set_routing_policy_rules(Link *link) { assert(link); assert(link->network); + if (link->routing_policy_rule_messages != 0) { + log_link_debug(link, "Routing policy rules are configuring."); + return 0; + } + link->routing_policy_rules_configured = false; HASHMAP_FOREACH(rule, link->network->rules_by_section) { diff --git a/src/network/networkd-sriov.c b/src/network/networkd-sriov.c index 68f43b5ce6..92c00d79e0 100644 --- a/src/network/networkd-sriov.c +++ b/src/network/networkd-sriov.c @@ -230,8 +230,15 @@ int link_configure_sr_iov(Link *link) { SRIOV *sr_iov; int r; + assert(link); + assert(link->network); + + if (link->sr_iov_messages != 0) { + log_link_debug(link, "SR-IOV is configuring."); + return 0; + } + link->sr_iov_configured = false; - link->sr_iov_messages = 0; ORDERED_HASHMAP_FOREACH(sr_iov, link->network->sr_iov_by_section) { r = sr_iov_configure(link, sr_iov); diff --git a/src/network/tc/tc.c b/src/network/tc/tc.c index c32b040919..0cd46cf633 100644 --- a/src/network/tc/tc.c +++ b/src/network/tc/tc.c @@ -39,8 +39,15 @@ int link_configure_traffic_control(Link *link) { TrafficControl *tc; int r; + assert(link); + assert(link->network); + + if (link->tc_messages != 0) { + log_link_debug(link, "Traffic control is configuring."); + return 0; + } + link->tc_configured = false; - link->tc_messages = 0; ORDERED_HASHMAP_FOREACH(tc, link->network->tc_by_section) { r = traffic_control_configure(link, tc); |