gdhcp: fix server address byte order
PATCH 1/1 gdhcp: fix server address byte order
The get_ip function calls inet_ntoa, which expects the IP address in network byte order.
--- gdhcp/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
gdhcp/client.c +1 -1
@@ -3036,7 +3036,7 @@ char *g_dhcp_client_get_server_address(GDHCPClient *dhcp_client)if (!dhcp_client)return NULL ; -return get_ip (dhcp_client->server_ip); +return get_ip (htonl (dhcp_client->server_ip)); }char *g_dhcp_client_get_address (GDHCPClient *dhcp_client)
Signature · 1 line
2.25.1
Quoted 2 lines · Ryan Smith
The
get_ipfunction callsinet_ntoa, which expects the IP address in network byte order.
Patch applied.
Thanks,
Daniel