summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2009-04-20 21:04:25 +0000
committerschwarze <schwarze@openbsd.org>2009-04-20 21:04:25 +0000
commit98a3d02320c4a07f03391d8b2cb066039b24c5d2 (patch)
treec2d90f3963dfd6e2a6a0ed991298080d43511076
parentDon't talk about a "scrub reassemble tcp" rule, talk about "reassemble (diff)
downloadwireguard-openbsd-98a3d02320c4a07f03391d8b2cb066039b24c5d2.tar.xz
wireguard-openbsd-98a3d02320c4a07f03391d8b2cb066039b24c5d2.zip
When receiving a new connection, log the remote IP number
in addition to the remote hostname. Feature requested by Mark Bucciarelli mkbucc at gmail dot com on misc@. "seems OK" millert@
-rw-r--r--libexec/ftpd/ftpd.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 797a3ea0dc7..4001ba597c2 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftpd.c,v 1.185 2008/09/30 16:16:21 deraadt Exp $ */
+/* $OpenBSD: ftpd.c,v 1.186 2009/04/20 21:04:25 schwarze Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
@@ -70,7 +70,7 @@ static const char copyright[] =
static const char sccsid[] = "@(#)ftpd.c 8.4 (Berkeley) 4/16/94";
#else
static const char rcsid[] =
- "$OpenBSD: ftpd.c,v 1.185 2008/09/30 16:16:21 deraadt Exp $";
+ "$OpenBSD: ftpd.c,v 1.186 2009/04/20 21:04:25 schwarze Exp $";
#endif
#endif /* not lint */
@@ -2174,8 +2174,13 @@ dolog(struct sockaddr *sa)
setproctitle("%s", proctitle);
#endif /* HASSETPROCTITLE */
- if (logging)
- syslog(LOG_INFO, "connection from %s", remotehost);
+ if (logging) {
+ int error;
+ error = getnameinfo(sa, sa->sa_len, hbuf, sizeof(hbuf),
+ NULL, 0, NI_NUMERICHOST);
+ syslog(LOG_INFO, "connection from %s [%s]", remotehost,
+ error ? gai_strerror(error) : hbuf);
+ }
}
/*