mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
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:
parent
28f49c088b
commit
3f3f6eee1c
@ -240,7 +240,11 @@ static void udp_recv_proc(void *arg, struct udp_pcb *upcb, struct pbuf *p, const
|
||||
unsigned n = p->len;
|
||||
if (n > sizeof(dhcp_data)) n = sizeof(dhcp_data);
|
||||
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:
|
||||
entry = entry_by_mac(dhcp_data.dp_chaddr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user