summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2008-03-17 20:40:05 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2008-03-17 20:40:05 +0000
commit583f604c7d739d890a9b7beca0574b9e9acff54c (patch)
tree0619ad0878b4014e56f4cfcb2779f89b5c5d68ce /usr.sbin
parente9e71ac6210984cff55bff2fa545eddf1b2b4e0d (diff)
two small bugs in printing funcs:
log_as < vs <= confusion, AS 65535 printed like 4 byte AS 0.65535 aspath_strlen: omitted stripping high 16 bits of 32bit AS after dealing with the upper half From: Matthew Dempsky <matthew@dempsky.org>
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/util.c b/usr.sbin/bgpd/util.c
index fe84d4f3424..b248eec0390 100644
--- a/usr.sbin/bgpd/util.c
+++ b/usr.sbin/bgpd/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.3 2007/05/11 11:27:59 claudio Exp $ */
+/* $OpenBSD: util.c,v 1.4 2008/03/17 20:40:04 henning Exp $ */
/*
* Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org>
@@ -79,7 +79,7 @@ log_as(u_int32_t as)
{
static char buf[12]; /* "65000.65000\0" */
- if (as < USHRT_MAX) {
+ if (as <= USHRT_MAX) {
if (snprintf(buf, sizeof(buf), "%u", as) == -1)
return ("?");
} else {
@@ -212,6 +212,7 @@ aspath_strlen(void *data, u_int16_t len)
else
total_size += 1;
total_size += 1; /* dot between hi & lo */
+ as &= 0xffff;
}
if (as >= 10000)
total_size += 5;