From 2c68b7877fa5a437d15d06476ecfd36f9a2678a6 Mon Sep 17 00:00:00 2001 From: starter48 <14238917+starter48@users.noreply.github.com> Date: Mon, 9 Jan 2023 10:53:26 +0700 Subject: [PATCH] Update local.c --- src/local.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/local.c b/src/local.c index fa1ca7b3..76d46de1 100644 --- a/src/local.c +++ b/src/local.c @@ -382,7 +382,7 @@ server_handshake(EV_P_ ev_io *w, buffer_t *buf) abuf->len += in_addr_len + 2; if (acl || verbose) { - uint16_t p = load16_be(buf->data + request_len + in_addr_len); + uint16_t p = ntohs(*(uint16_t*)(buf->data + request_len + in_addr_len)); if (!inet_ntop(AF_INET, (const void *)(buf->data + request_len), ip, INET_ADDRSTRLEN)) { LOGI("inet_ntop(AF_INET): %s", strerror(errno)); @@ -400,7 +400,7 @@ server_handshake(EV_P_ ev_io *w, buffer_t *buf) abuf->len += name_len + 2; if (acl || verbose) { - uint16_t p = load16_be(buf->data + request_len + 1 + name_len); + uint16_t p = ntohs(*(uint16_t*)(buf->data + request_len + 1 + name_len)); memcpy(host, buf->data + request_len + 1, name_len); host[name_len] = '\0'; sprintf(port, "%d", p); @@ -414,7 +414,7 @@ server_handshake(EV_P_ ev_io *w, buffer_t *buf) abuf->len += in6_addr_len + 2; if (acl || verbose) { - uint16_t p = load16_be(buf->data + request_len + in6_addr_len); + uint16_t p = ntohs(*(uint16_t*)(buf->data + request_len + in6_addr_len)); if (!inet_ntop(AF_INET6, (const void *)(buf->data + request_len), ip, INET6_ADDRSTRLEN)) { LOGI("inet_ntop(AF_INET6): %s", strerror(errno));