1 --- a/sysklogd/syslogd.c
2 +++ b/sysklogd/syslogd.c
3 @@ -98,6 +98,8 @@ struct globals {
6 #if ENABLE_FEATURE_REMOTE_LOG
7 + len_and_sockaddr *remoteAddr;
11 #if ENABLE_FEATURE_IPC_SYSLOG
12 @@ -554,6 +556,7 @@ static void do_syslogd(void) NORETURN;
13 static void do_syslogd(void)
17 #if ENABLE_FEATURE_REMOTE_LOG
20 @@ -637,10 +640,23 @@ static void do_syslogd(void)
23 /* Send message to remote logger, ignore possible error */
24 - /* TODO: on some errors, close and set G.remoteFD to -1
25 - * so that DNS resolution and connect is retried? */
26 - sendto(rh->remoteFD, recvbuf, sz+1, MSG_DONTWAIT,
27 - &(rh->remoteAddr->u.sa), rh->remoteAddr->len);
28 + if (sendto(rh->remoteFD, recvbuf, sz+1, MSG_DONTWAIT,
29 + &G.remoteAddr->u.sa, G.remoteAddr->len) == -1 ) {
33 + /* On some errors, close and set G.remoteFD to -1
34 + * so that DNS resolution and connect is retried */
47 if (!ENABLE_FEATURE_REMOTE_LOG || (option_mask32 & OPT_locallog)) {