connman.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] gdhcp: fix server address byte order
@ 2022-04-11 15:20 Ryan Smith
  2022-04-14 18:48 ` Daniel Wagner
  0 siblings, 1 reply; 2+ messages in thread
From: Ryan Smith @ 2022-04-11 15:20 UTC (permalink / raw)
  To: connman; +Cc: Ryan Smith

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(-)

diff --git a/gdhcp/client.c b/gdhcp/client.c
index 3016dfc2..7efa7e45 100644
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -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)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] gdhcp: fix server address byte order
  2022-04-11 15:20 [PATCH v1] gdhcp: fix server address byte order Ryan Smith
@ 2022-04-14 18:48 ` Daniel Wagner
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Wagner @ 2022-04-14 18:48 UTC (permalink / raw)
  To: Ryan Smith; +Cc: connman

On Mon, Apr 11, 2022 at 09:20:39AM -0600, Ryan Smith wrote:
> The get_ip function calls inet_ntoa, which expects the IP address
> in network byte order.

Patch applied.

Thanks,
Daniel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-14 18:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11 15:20 [PATCH v1] gdhcp: fix server address byte order Ryan Smith
2022-04-14 18:48 ` Daniel Wagner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).