]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
dhcp: Fix warning regarding unaligned pointer value due to packed struct
authorTobias Brunner <tobias@strongswan.org>
Thu, 14 Sep 2017 17:33:07 +0000 (19:33 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 18 Sep 2017 10:16:54 +0000 (12:16 +0200)
We don't need to access this as uint32_t so just cast it to a char*.

src/libcharon/plugins/dhcp/dhcp_socket.c

index 4f4e1ffe0f1eeeefe8774ef992c218d33933507f..7541c3b4921f1bea6ab15d6d9e6a05b3796d5608 100644 (file)
@@ -438,7 +438,7 @@ METHOD(dhcp_socket_t, release, void,
        DBG1(DBG_CFG, "sending DHCP RELEASE for %H to %H", release, server);
 
        chunk = release->get_address(release);
-       memcpy(&dhcp.client_address, chunk.ptr,
+       memcpy((char*)&dhcp.client_address, chunk.ptr,
                   min(chunk.len, sizeof(dhcp.client_address)));
 
        option = (dhcp_option_t*)&dhcp.options[optlen];