]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Log: Fixed race condition in reconfigure while BFD is running
authorMaria Matejka <mq@ucw.cz>
Tue, 30 Jul 2019 10:11:12 +0000 (12:11 +0200)
committerMaria Matejka <mq@ucw.cz>
Tue, 30 Jul 2019 10:13:38 +0000 (12:13 +0200)
sysdep/unix/log.c

index 22291dc1e6e8d7555089f68cd93ac9fc3ba2480f..034861f84ea0f9793a8b5a6ba6b686479294c6e1 100644 (file)
@@ -294,12 +294,14 @@ log_switch(int debug, list *l, char *new_syslog_name)
   if (!l || EMPTY_LIST(*l))
     l = default_log_list(debug, !l, &new_syslog_name);
 
+  log_lock();
+
   current_log_list = l;
 
 #ifdef HAVE_SYSLOG_H
   if (current_syslog_name && new_syslog_name &&
       !strcmp(current_syslog_name, new_syslog_name))
-    return;
+    goto done;
 
   if (current_syslog_name)
   {
@@ -314,6 +316,9 @@ log_switch(int debug, list *l, char *new_syslog_name)
     openlog(current_syslog_name, LOG_CONS | LOG_NDELAY, LOG_DAEMON);
   }
 #endif
+
+done:
+  log_unlock();
 }