summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-05-16 15:43:23 +0000
committerRoy Marples <roy@marples.name>2016-05-16 15:43:23 +0000
commitf434962c16325e822a78f2f119942a7e4f93b93c (patch)
treebc11cd10ca9fb28a90739e4dba2de146daa77ba2
parentf346c6f99e49e4c80963f27044d5b39ba42dd529 (diff)
downloaddhcpcd-f434962c16325e822a78f2f119942a7e4f93b93c.tar.xz
Only accept BOOTREPLY.
-rw-r--r--dhcp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/dhcp.c b/dhcp.c
index cdfbc941..5e6ecb47 100644
--- a/dhcp.c
+++ b/dhcp.c
@@ -2669,6 +2669,12 @@ dhcp_handledhcp(struct interface *ifp, struct bootp *bootp, size_t bootp_len,
#define LOGDHCP(l, m) \
log_dhcp((l), (m), ifp, bootp, bootp_len, from, 1)
+ if (bootp->op != BOOTREPLY) {
+ logger(ifp->ctx, LOG_DEBUG, "%s: op (%d) is not BOOTREPLY",
+ ifp->name, bootp->op);
+ return;
+ }
+
/* Ensure packet is for us */
if (ifp->hwlen <= sizeof(bootp->chaddr) &&
memcmp(bootp->chaddr, ifp->hwaddr, ifp->hwlen))