From: Roy Marples Date: Sun, 13 Apr 2008 15:33:00 +0000 (+0000) Subject: We should check the cookie on messages. X-Git-Tag: v4.0.2~500 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1eda499e124e4ceb315913acd43fddf0248e4621;p=thirdparty%2Fdhcpcd.git We should check the cookie on messages. --- diff --git a/client.c b/client.c index 391df175..bab77fcf 100644 --- 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"