diff options
author | 2018-03-29 18:29:24 +0000 | |
---|---|---|
committer | 2018-03-29 18:29:24 +0000 | |
commit | 18e8598b8a69755cdefe1491a8dd1817c8cfeb1e (patch) | |
tree | e101ec358e0259b45303fe52e589299df79dd438 | |
parent | mvrtc(4) (diff) | |
download | wireguard-openbsd-18e8598b8a69755cdefe1491a8dd1817c8cfeb1e.tar.xz wireguard-openbsd-18e8598b8a69755cdefe1491a8dd1817c8cfeb1e.zip |
Make sure that the global config is send out immediately when it is
loaded. This makes sure that the local prefix specied in the config is
always used.
OK ccardenas@
-rw-r--r-- | usr.sbin/vmd/vmd.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/usr.sbin/vmd/vmd.c b/usr.sbin/vmd/vmd.c index 354630401cd..2ec87a7f006 100644 --- a/usr.sbin/vmd/vmd.c +++ b/usr.sbin/vmd/vmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmd.c,v 1.81 2018/03/14 07:29:34 mlarkin Exp $ */ +/* $OpenBSD: vmd.c,v 1.82 2018/03/29 18:29:24 martijn Exp $ */ /* * Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org> @@ -828,6 +828,10 @@ vmd_configure(void) exit(0); } + /* Send shared global configuration to all children */ + if (config_setconfig(env) == -1) + return (-1); + TAILQ_FOREACH(vsw, env->vmd_switches, sw_entry) { if (vsw->sw_running) continue; @@ -850,10 +854,6 @@ vmd_configure(void) return (-1); } - /* Send shared global configuration to all children */ - if (config_setconfig(env) == -1) - return (-1); - return (0); } @@ -893,10 +893,6 @@ vmd_reload(unsigned int reset, const char *filename) vm_remove(vm); } } - - /* Update shared global configuration in all children */ - if (config_setconfig(env) == -1) - return (-1); } if (parse_config(filename) == -1) { @@ -905,6 +901,12 @@ vmd_reload(unsigned int reset, const char *filename) return (-1); } + if (reload) { + /* Update shared global configuration in all children */ + if (config_setconfig(env) == -1) + return (-1); + } + TAILQ_FOREACH(vsw, env->vmd_switches, sw_entry) { if (vsw->sw_running) continue; |