diff --git a/src/log.c b/src/log.c index e202462e3..2b4b8388d 100644 --- a/src/log.c +++ b/src/log.c @@ -1051,7 +1051,7 @@ int parse_logsrv(char **args, struct list *logsrvs, int do_del, const char *file set_host_port(&logsrv->addr, SYSLOG_PORT); } - if (proto->ctrl_type == SOCK_STREAM) { + if (proto && proto->ctrl_type == SOCK_STREAM) { static unsigned long ring_ids; /* Implicit sink buffer will be diff --git a/src/tools.c b/src/tools.c index 9cb4e89fb..7bb9b0598 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1218,7 +1218,8 @@ struct sockaddr_storage *str2sa_range(const char *str, int *port, int *low, int if (proto || (opts & PA_O_CONNECT)) { /* Note: if the caller asks for a proto, we must find one, - * except if we return with an fqdn that will resolve later, + * except if we inherit from a raw FD (family == AF_CUST_EXISTING_FD) + * orif we return with an fqdn that will resolve later, * in which case the address is not known yet (this is only * for servers actually). */ @@ -1226,7 +1227,7 @@ struct sockaddr_storage *str2sa_range(const char *str, int *port, int *low, int sock_type == SOCK_DGRAM, ctrl_type == SOCK_DGRAM); - if (!new_proto && (!fqdn || !*fqdn)) { + if (!new_proto && (!fqdn || !*fqdn) && (ss.ss_family != AF_CUST_EXISTING_FD)) { memprintf(err, "unsupported protocol family %d for address '%s'", ss.ss_family, str); goto out; }