dhserver: Support DHCP clients that don't send the MESSAGETYPE as first option
Signed-off-by: Jannis Achstetter <kripton@kripserver.net>
This commit is contained in:
@@ -240,7 +240,11 @@ static void udp_recv_proc(void *arg, struct udp_pcb *upcb, struct pbuf *p, const
|
|||||||
unsigned n = p->len;
|
unsigned n = p->len;
|
||||||
if (n > sizeof(dhcp_data)) n = sizeof(dhcp_data);
|
if (n > sizeof(dhcp_data)) n = sizeof(dhcp_data);
|
||||||
memcpy(&dhcp_data, p->payload, n);
|
memcpy(&dhcp_data, p->payload, n);
|
||||||
switch (dhcp_data.dp_options[2])
|
|
||||||
|
ptr = find_dhcp_option(dhcp_data.dp_options, sizeof(dhcp_data.dp_options), DHCP_MESSAGETYPE);
|
||||||
|
if (ptr == NULL) return;
|
||||||
|
|
||||||
|
switch (ptr[2])
|
||||||
{
|
{
|
||||||
case DHCP_DISCOVER:
|
case DHCP_DISCOVER:
|
||||||
entry = entry_by_mac(dhcp_data.dp_chaddr);
|
entry = entry_by_mac(dhcp_data.dp_chaddr);
|
||||||
|
Reference in New Issue
Block a user