dhcp6: use offsetof instead of sizeof
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 27 Sep 2018 14:31:34 +0000 (23:31 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 27 Sep 2018 14:41:23 +0000 (23:41 +0900)
src/libsystemd-network/sd-dhcp6-client.c

index 74bf38b..6e7ccce 100644 (file)
@@ -1001,7 +1001,7 @@ static int client_parse_message(
                         break;
                 }
 
-                pos += sizeof(*option) + optlen;
+                pos += offsetof(DHCP6Option, data) + optlen;
         }
 
         if (!clientid) {