diff options
author | 2014-11-11 07:15:33 +0000 | |
---|---|---|
committer | 2014-11-11 07:15:33 +0000 | |
commit | 06bcde9cfd149d635e44e71aa07381f28bd69291 (patch) | |
tree | 678209a8824a813edeccef244a64e893480fbf5a | |
parent | Don't free garbage in ec_wNAF_mul() if wNAF could be allocated but (diff) | |
download | wireguard-openbsd-06bcde9cfd149d635e44e71aa07381f28bd69291.tar.xz wireguard-openbsd-06bcde9cfd149d635e44e71aa07381f28bd69291.zip |
The default output format for 32bit AS numbers has moved from AS_DOT+
to ASPLAIN.
Of course, you can still input AS numbers in either format.
OK henning@, claudio@, benno@, sthen@
-rw-r--r-- | usr.sbin/bgpd/util.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/usr.sbin/bgpd/util.c b/usr.sbin/bgpd/util.c index 854adc4dc6b..3ae38bcc1cc 100644 --- a/usr.sbin/bgpd/util.c +++ b/usr.sbin/bgpd/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.17 2013/10/30 17:28:33 deraadt Exp $ */ +/* $OpenBSD: util.c,v 1.18 2014/11/11 07:15:33 phessler Exp $ */ /* * Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org> @@ -92,16 +92,11 @@ log_sockaddr(struct sockaddr *sa) const char * log_as(u_int32_t as) { - static char buf[12]; /* "65000.65000\0" */ + static char buf[11]; /* "4294967294\0" */ + + if (snprintf(buf, sizeof(buf), "%u", as) == -1) + return ("?"); - if (as <= USHRT_MAX) { - if (snprintf(buf, sizeof(buf), "%u", as) == -1) - return ("?"); - } else { - if (snprintf(buf, sizeof(buf), "%u.%u", as >> 16, - as & 0xffff) == -1) - return ("?"); - } return (buf); } |