summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/log.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-04-25 01:52:12 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-04-25 01:52:12 +0000
commit97cb5aa71bc240da12a1cffdffa870eb673a68af (patch)
treed6c4ae9f765bcc3ec7e17efb8a5cfaeb143ed92d /usr.sbin/bgpd/log.c
parent816ab97f55c2e4431802dc10bc28214ab89ebaf1 (diff)
unbreak log_conn_attempt, bah crap crap crap crap crap crap crap crap crap
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 {