summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2019-02-01 13:05:55 +0000
committerflorian <florian@openbsd.org>2019-02-01 13:05:55 +0000
commit9c8ccd7032fdb32d87720955fd99d5b6ea40073b (patch)
tree4a8fd042d0ad82c019f9834adfb6cb449a4d5d8d
parentmake m_pullup use the first mbuf with data to measure alignment. (diff)
downloadwireguard-openbsd-9c8ccd7032fdb32d87720955fd99d5b6ea40073b.tar.xz
wireguard-openbsd-9c8ccd7032fdb32d87720955fd99d5b6ea40073b.zip
port is in network byte order
-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;
}