]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
dhcp: Don't use signed char for DHCP options
authorTobias Brunner <tobias@strongswan.org>
Thu, 14 Sep 2017 17:11:10 +0000 (19:11 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 18 Sep 2017 10:16:54 +0000 (12:16 +0200)
The value of DHCP_OPTEND is 255.  When it is assigned this result in a
sign change as the positive int constant is cast to a signed char and -1
results. Clang 4.0 complains about this.

src/libcharon/plugins/dhcp/dhcp_socket.c

index 42f8f1ef975d1242d734de16cab83952d3051e2e..4f4e1ffe0f1eeeefe8774ef992c218d33933507f 100644 (file)
@@ -176,7 +176,7 @@ typedef struct __attribute__((packed)) {
        char server_hostname[64];
        char boot_filename[128];
        uint32_t magic_cookie;
-       char options[252];
+       u_char options[252];
 } dhcp_t;
 
 /**