chiark / gitweb /
sd-dhcp-client: move magic cookie into DHCPMessage struct
[elogind.git] / src / libsystemd-network / dhcp-option.c
index 4d45b3b3a47a998d02f4e3b3f3b82a6e88ac66de..1b92e8616bbfa1ba95756be42b94180a6da738fd 100644 (file)
@@ -149,17 +149,13 @@ int dhcp_option_parse(DHCPMessage *message, size_t len,
         if (!message)
                 return -EINVAL;
 
-        if (len < sizeof(DHCPMessage) + 4)
+        if (len < sizeof(DHCPMessage))
                 return -EINVAL;
 
-        len -= sizeof(DHCPMessage) + 4;
+        len -= sizeof(DHCPMessage);
 
-        if (opt[0] != 0x63 && opt[1] != 0x82 && opt[2] != 0x53 &&
-                        opt[3] != 0x63)
-                return -EINVAL;
-
-        res = parse_options(&opt[4], len, &overload, &message_type,
-                        cb, user_data);
+        res = parse_options(opt, len, &overload, &message_type,
+                            cb, user_data);
         if (res < 0)
                 return res;