summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-manager.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-09-29 10:32:55 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-09-29 13:50:37 +0200
commit4c78dc17e533b382af0db1cbb08aa89b1b36885f (patch)
tree80f6c357f92a51d8fa3953fec2beac9ad8573d73 /src/network/networkd-manager.c
parentMerge pull request #20802 from yuwata/network-receive-nl80211-multicast-messages (diff)
downloadsystemd-4c78dc17e533b382af0db1cbb08aa89b1b36885f.tar.xz
systemd-4c78dc17e533b382af0db1cbb08aa89b1b36885f.zip
network: do not update state files when running in test mode
Fixes #20862.
Diffstat (limited to 'src/network/networkd-manager.c')
-rw-r--r--src/network/networkd-manager.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
index f9cfb64512..5c6afdb0ff 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
@@ -382,7 +382,7 @@ static int signal_restart_callback(sd_event_source *s, const struct signalfd_sig
return sd_event_exit(sd_event_source_get_event(s), 0);
}
-int manager_setup(Manager *m, bool test_mode) {
+int manager_setup(Manager *m) {
int r;
assert(m);
@@ -414,7 +414,7 @@ int manager_setup(Manager *m, bool test_mode) {
if (r < 0)
return r;
- if (test_mode)
+ if (m->test_mode)
return 0;
r = manager_connect_bus(m);
@@ -444,7 +444,7 @@ int manager_setup(Manager *m, bool test_mode) {
return 0;
}
-int manager_new(Manager **ret) {
+int manager_new(Manager **ret, bool test_mode) {
_cleanup_(manager_freep) Manager *m = NULL;
m = new(Manager, 1);
@@ -452,6 +452,7 @@ int manager_new(Manager **ret) {
return -ENOMEM;
*m = (Manager) {
+ .test_mode = test_mode,
.speed_meter_interval_usec = SPEED_METER_DEFAULT_TIME_INTERVAL,
.online_state = _LINK_ONLINE_STATE_INVALID,
.manage_foreign_routes = true,