/* Find a dhcp client node by ip address */
static struct dhcp_client_node* dhcp_client_find(struct dhcp_server *dhcpserver, struct dhcp_msg *msg, u8_t *opt_buf, u16_t len)
/* Find a dhcp client node by ip address */
static struct dhcp_client_node* dhcp_client_find(struct dhcp_server *dhcpserver, struct dhcp_msg *msg, u8_t *opt_buf, u16_t len)
{
    u8_t *opt;
    struct dhcp_client_node *node;
    node = dhcp_client_find_by_mac(dhcpserver, msg->chaddr, msg->hlen);
    if (node != NULL)
    {
        return node;
    }
    opt = dhcp_server_option_find(opt_buf, len, DHCP_OPTION_REQUESTED_IP);
    if (opt != NULL)
    {
        node = dhcp_client_find_by_ip(dhcpserver, (ip4_addr_t *)(&opt[2]));
        if (node != NULL)
        {
            return node;
        }
    }
    return NULL;
}