Fix strict aliasing warning
authorMartin Willi <martin@revosec.ch>
Wed, 25 May 2011 08:08:55 +0000 (10:08 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 25 May 2011 08:09:16 +0000 (10:09 +0200)
src/libstrongswan/plugins/af_alg/af_alg_ops.c

index 82a227d..a7b5de2 100644 (file)
@@ -122,7 +122,7 @@ METHOD(af_alg_ops_t, crypt, void,
        cmsg->cmsg_level = SOL_ALG;
        cmsg->cmsg_type = ALG_SET_OP;
        cmsg->cmsg_len = CMSG_LEN(sizeof(type));
-       *(u_int32_t*)CMSG_DATA(cmsg) = type;
+       memcpy(CMSG_DATA(cmsg), &type, sizeof(type));
 
        cmsg = CMSG_NXTHDR(&msg, cmsg);
        cmsg->cmsg_level = SOL_ALG;