mirror of
https://github.com/openbsd/src.git
synced 2026-06-18 07:13:36 +02:00
Log a dummy "<unknown>" IP address in the unlikely event that genameinfo(3) fails
clang-16 warning reported by robert@, ok tb@ millert@
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: spamd.c,v 1.160 2023/04/19 12:58:15 jsg Exp $ */
|
||||
/* $OpenBSD: spamd.c,v 1.161 2023/09/05 16:01:58 jca Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2015 Henning Brauer <henning@openbsd.org>
|
||||
@@ -728,10 +728,8 @@ initcon(struct con *cp, int fd, struct sockaddr *sa)
|
||||
0 : stutter;
|
||||
error = getnameinfo(sa, sa->sa_len, cp->addr, sizeof(cp->addr), NULL, 0,
|
||||
NI_NUMERICHOST);
|
||||
#ifdef useless
|
||||
if (error)
|
||||
errx(1, "%s", gai_strerror(error));
|
||||
#endif
|
||||
strlcpy(cp->addr, "<unknown>", sizeof(cp->addr));
|
||||
ctime_r(&t, ctimebuf);
|
||||
ctimebuf[sizeof(ctimebuf) - 2] = '\0'; /* nuke newline */
|
||||
snprintf(cp->obuf, cp->osize, "220 %s ESMTP %s; %s\r\n",
|
||||
|
||||
Reference in New Issue
Block a user