Skip to content

Commit 63fed92

Browse files
lstipakovcron2
authored andcommitted
Fix wrong byte order of --dns server
We already fixed it in commit 82fd89a, but the fix got lost in 2dfc4f8. tuntap_options require host byte order, and we store dns servers in struct dns_server in network byte order, what we got from getaddrinfo(). Fix (again) by converting to the host byte order. Change-Id: I37ca672f05e9d77ec586fa28dadc6dc752e574fb Signed-off-by: Lev Stipakov <lev@openvpn.net> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <20250731152912.21826-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32460.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
1 parent 70d4c67 commit 63fed92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/openvpn/options.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3573,7 +3573,7 @@ tuntap_options_postprocess_dns(struct options *o)
35733573
{
35743574
if (s->addr[i].family == AF_INET && tt->dns_len + 1 < N_DHCP_ADDR)
35753575
{
3576-
tt->dns[tt->dns_len++] = s->addr[i].in.a4.s_addr;
3576+
tt->dns[tt->dns_len++] = ntohl(s->addr[i].in.a4.s_addr);
35773577
}
35783578
else if (tt->dns6_len + 1 < N_DHCP_ADDR)
35793579
{

0 commit comments

Comments
 (0)