|
@@ -1170,6 +1170,16 @@ int main_loop()
|
|
LOG(L_WARN, "WARNING: using only the first listen address"
|
|
LOG(L_WARN, "WARNING: using only the first listen address"
|
|
" (no fork)\n");
|
|
" (no fork)\n");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /* Register the children that will keep updating their
|
|
|
|
+ * local configuration */
|
|
|
|
+ cfg_register_child(
|
|
|
|
+ 1 /* main = udp listener */
|
|
|
|
+ + 1 /* timer */
|
|
|
|
+#ifdef USE_SLOW_TIMER
|
|
|
|
+ + 1 /* slow timer */
|
|
|
|
+#endif
|
|
|
|
+ );
|
|
if (do_suid()==-1) goto error; /* try to drop privileges */
|
|
if (do_suid()==-1) goto error; /* try to drop privileges */
|
|
/* process_no now initialized to zero -- increase from now on
|
|
/* process_no now initialized to zero -- increase from now on
|
|
as new processes are forked (while skipping 0 reserved for main
|
|
as new processes are forked (while skipping 0 reserved for main
|
|
@@ -1252,6 +1262,16 @@ int main_loop()
|
|
return udp_rcv_loop();
|
|
return udp_rcv_loop();
|
|
}else{ /* fork: */
|
|
}else{ /* fork: */
|
|
|
|
|
|
|
|
+ /* Register the children that will keep updating their
|
|
|
|
+ * local configuration. (udp/tcp/sctp listeneres
|
|
|
|
+ * will be added later.) */
|
|
|
|
+ cfg_register_child(
|
|
|
|
+ 1 /* timer */
|
|
|
|
+#ifdef USE_SLOW_TIMER
|
|
|
|
+ + 1 /* slow timer */
|
|
|
|
+#endif
|
|
|
|
+ );
|
|
|
|
+
|
|
for(si=udp_listen;si;si=si->next){
|
|
for(si=udp_listen;si;si=si->next){
|
|
/* create the listening socket (for each address)*/
|
|
/* create the listening socket (for each address)*/
|
|
/* udp */
|
|
/* udp */
|
|
@@ -1265,6 +1285,8 @@ int main_loop()
|
|
(si->address.af==AF_INET6))
|
|
(si->address.af==AF_INET6))
|
|
sendipv6=si;
|
|
sendipv6=si;
|
|
#endif
|
|
#endif
|
|
|
|
+ /* children_no per each socket */
|
|
|
|
+ cfg_register_child(children_no);
|
|
}
|
|
}
|
|
#ifdef USE_SCTP
|
|
#ifdef USE_SCTP
|
|
if (!sctp_disable){
|
|
if (!sctp_disable){
|
|
@@ -1281,6 +1303,8 @@ int main_loop()
|
|
(si->address.af==AF_INET6))
|
|
(si->address.af==AF_INET6))
|
|
sendipv6_sctp=si;
|
|
sendipv6_sctp=si;
|
|
#endif
|
|
#endif
|
|
|
|
+ /* sctp_children_no per each socket */
|
|
|
|
+ cfg_register_child(sctp_children_no);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
#endif /* USE_SCTP */
|
|
#endif /* USE_SCTP */
|
|
@@ -1301,6 +1325,8 @@ int main_loop()
|
|
sendipv6_tcp=si;
|
|
sendipv6_tcp=si;
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
|
|
+ /* the number of sockets does not matter */
|
|
|
|
+ cfg_register_child(tcp_children_no + 1 /* tcp main */);
|
|
}
|
|
}
|
|
#ifdef USE_TLS
|
|
#ifdef USE_TLS
|
|
if (!tls_disable && tls_has_init_si()){
|
|
if (!tls_disable && tls_has_init_si()){
|