]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
We should check the cookie on messages.
authorRoy Marples <roy@marples.name>
Sun, 13 Apr 2008 15:33:00 +0000 (15:33 +0000)
committerRoy Marples <roy@marples.name>
Sun, 13 Apr 2008 15:33:00 +0000 (15:33 +0000)
client.c

index 391df175d179fab8dede0c2f1b3492def42a59aa..bab77fcf6d6382ea08e2987daf9a2674abc95ba7 100644 (file)
--- a/client.c
+++ b/client.c
@@ -1182,6 +1182,10 @@ handle_packet(struct if_state *state, const struct options *options)
                               &state->buffer_len, &state->buffer_pos) == -1)
                        break;
 
+               if (dhcp->cookie != htonl(MAGIC_COOKIE)) {
+                       logger(LOG_DEBUG, "bogus cookie, ignoring");
+                       continue;
+               }
                if (state->xid != dhcp->xid) {
                        logger(LOG_DEBUG,
                               "ignoring packet with xid 0x%x as"