As the server_nip is already in network byte order, we must not
convert the received server id option to host byte order.

This used to work as we sent the server id in wrong byte order
and then swapped it back here. But because of previous fix to
sent the server id in network byte order, this receiving end
needs some changes also.
---
 gdhcp/server.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdhcp/server.c b/gdhcp/server.c
index 97c16c2..8574c24 100644
--- a/gdhcp/server.c
+++ b/gdhcp/server.c
@@ -668,7 +668,8 @@ static gboolean listener_event(GIOChannel *channel, 
GIOCondition condition,
 
        server_id_option = dhcp_get_option(&packet, DHCP_SERVER_ID);
        if (server_id_option) {
-               uint32_t server_nid = get_be32(server_id_option);
+               uint32_t server_nid =
+                       get_unaligned((const uint32_t *) server_id_option);
 
                if (server_nid != dhcp_server->server_nip)
                        return TRUE;
-- 
1.8.3.1

_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to