summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bgpd/log.c')
-rw-r--r--usr.sbin/bgpd/log.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/log.c b/usr.sbin/bgpd/log.c
index 7273db6472b..3575d886fd3 100644
--- a/usr.sbin/bgpd/log.c
+++ b/usr.sbin/bgpd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.31 2004/04/16 04:47:19 henning Exp $ */
+/* $OpenBSD: log.c,v 1.32 2004/04/25 01:52:11 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -23,6 +23,7 @@
#include <err.h>
#include <errno.h>
+#include <netdb.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@@ -368,7 +369,8 @@ log_conn_attempt(const struct peer *peer, struct sockaddr *sa)
if (peer == NULL) { /* connection from non-peer, drop */
- if (inet_ntop(sa->sa_family, sa, buf, sizeof(buf)) == NULL)
+ if (getnameinfo(sa, sa->sa_len, buf, sizeof(buf), NULL, 0,
+ NI_NUMERICHOST))
strlcpy(buf, "(unknown)", sizeof(buf));
logit(LOG_INFO, "connection from non-peer %s refused", buf);
} else {