diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-01-27 21:20:45 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-01-27 21:20:45 +0000 |
commit | f38a877d9c4748f98c02a99ee86580846b6b6ec0 (patch) | |
tree | eef33a5d220d385ebe206365404cf907f08bfe3c /usr.sbin/bgpd | |
parent | b6a1aebeff778fc30c6c1e413fcad4ae694a34da (diff) |
use inet_ntop() for log_addr(), claudio ok
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/log.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/usr.sbin/bgpd/log.c b/usr.sbin/bgpd/log.c index bbece753be9..1fda8f69fb4 100644 --- a/usr.sbin/bgpd/log.c +++ b/usr.sbin/bgpd/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.23 2004/01/27 16:49:53 henning Exp $ */ +/* $OpenBSD: log.c,v 1.24 2004/01/27 21:20:44 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -383,11 +383,12 @@ log_ntoa(in_addr_t ip) } char * -log_addr(const struct bgpd_addr *addr) { - switch (addr->af) { - case AF_INET: - return (inet_ntoa(addr->v4)); - default: - return ("(unknown address family)"); - } +log_addr(const struct bgpd_addr *addr) +{ + static char buf[48]; + + if(inet_ntop(addr->af, &addr->ba, buf, sizeof(buf)) == NULL) + return ("?"); + else + return (buf); } |