summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2019-02-01 13:05:56 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2019-02-01 13:05:56 +0000
commit2a069bed30a8b43cab87f2cdbad11cb5d1cbfe14 (patch)
tree916dd1c851e3c87f0bb48bb3cd11aa55228f9016 /sbin
parent37b7e3a7dc2e91e597a7a963d3869660315b5e3f (diff)
port is in network byte order
Diffstat (limited to 'sbin')
-rw-r--r--sbin/unwind/frontend.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/unwind/frontend.c b/sbin/unwind/frontend.c
index 422cef78770..ab8dfececa8 100644
--- a/sbin/unwind/frontend.c
+++ b/sbin/unwind/frontend.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: frontend.c,v 1.8 2019/01/30 12:54:34 benno Exp $ */
+/* $OpenBSD: frontend.c,v 1.9 2019/02/01 13:05:55 florian Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -681,11 +681,11 @@ ip_port(struct sockaddr *sa)
}
if (sa->sa_family == AF_INET6)
- snprintf(buf, sizeof(buf), "[%s]:%d", hbuf,
- ((struct sockaddr_in6 *)sa)->sin6_port);
+ snprintf(buf, sizeof(buf), "[%s]:%d", hbuf, ntohs(
+ ((struct sockaddr_in6 *)sa)->sin6_port));
if (sa->sa_family == AF_INET)
- snprintf(buf, sizeof(buf), "[%s]:%d", hbuf,
- ((struct sockaddr_in *)sa)->sin_port);
+ snprintf(buf, sizeof(buf), "[%s]:%d", hbuf, ntohs(
+ ((struct sockaddr_in *)sa)->sin_port));
return buf;
}