]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Set the magic cookie on our faked DHCP messages so we correctly get
authorRoy Marples <roy@marples.name>
Fri, 29 May 2015 13:42:28 +0000 (13:42 +0000)
committerRoy Marples <roy@marples.name>
Fri, 29 May 2015 13:42:28 +0000 (13:42 +0000)
the subnet.
Fixes [ea294abc09].

dhcp.c

diff --git a/dhcp.c b/dhcp.c
index 9a6cd27a8985454f54a2d59a8f85334ed862447a..5eb7f466e86cc9a44eb8b4f687996f4e1e9d5ef3 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -2160,6 +2160,7 @@ dhcp_message_new(const struct in_addr *addr, const struct in_addr *mask)
        if (dhcp == NULL)
                return NULL;
        dhcp->yiaddr = addr->s_addr;
+       dhcp->cookie = htonl(MAGIC_COOKIE);
        p = dhcp->options;
        if (mask && mask->s_addr != INADDR_ANY) {
                *p++ = DHO_SUBNETMASK;