X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/143464d58d2bd6378e74eec636961ceb0d32fb91..fe8ab488e9161c46dd9885d58fc52996dc0249ff:/bsd/netinet/in_dhcp.c?ds=inline diff --git a/bsd/netinet/in_dhcp.c b/bsd/netinet/in_dhcp.c index 001e1058f..e7f8ab6a8 100644 --- a/bsd/netinet/in_dhcp.c +++ b/bsd/netinet/in_dhcp.c @@ -211,10 +211,10 @@ make_dhcp_request(struct dhcp * request, int request_size, uint8_t cid[ETHER_ADDR_LEN + 1]; uint8_t rfc_magic[RFC_MAGIC_SIZE] = RFC_OPTIONS_MAGIC; - if (hwlen > (int)sizeof(cid)) { + if (hwlen >= (int)sizeof(cid)) { printf("dhcp: hwlen is %d (> %d), truncating\n", hwlen, (int)sizeof(cid)); - hwlen = sizeof(cid); + hwlen = sizeof(cid) - 1; } bzero(request, request_size); request->dp_op = BOOTREQUEST;