I have a KSZ8863 3 port switch that provides two Ethernet ports (using 2 port mode). Everything is working well sending packets through the TAP interfaces. ARP, ICMP, UDP packet flow all as expected.
Now I want to take one port and make it an isolated port that provides a DHCP Server to devices connected to that port. The other port can be a static or DHCP client port as configured by the user.
When I try to enable the DHCP server on one or both ports, I get errors.
I have set the appropriate flags in the esp_netif_inherent_config_t structure:
Code: Select all
esp_netif_config.flags &= ~ESP_NETIF_DHCP_CLIENT;
esp_netif_config.flags |= ESP_NETIF_DHCP_SERVER;
esp_netif_config.flags |= ESP_NETIF_AUTOUP;
dhcps_start(): could not obtain pcb and
esp_netif_lwip: DHCP server cannot be started.
Looking at the framework code:
Code: Select all
dhcps->dhcps_pcb = udp_new();
if( dhcps->dhcps_pcb == NULL || ip4_addr_isany_val(ip)) {
DHCPS_LOG("dhcps_start(): could not obtain pcb\n");
return ERR_ARG;
}
Is there some other condition I need to satisfy before bringing up the interface? If the DHCP server is starting, it seems like it would need to have an IP set so it can act as a DHCP server.
Any thoughts?
Thanks!
Mike