Closed pmarches closed 3 years ago
Hi @pmarches
Thanks for the report! My guess is that the esp-idf ethernet port layer inputs packets to lwip by reference only and doesn't support the ESP_L2_TO_L3_COPY
(option to plain memcpy input data from the driver layer to the stack) the same way as WiFi interface.
Could you please test your setup with this patch applied to the esp-idf? 0001-lwip-Fix-ethernet-port-to-use-ESP_L2_TO_L3_COPY.patch.txt
That totally worked! Amazing how I have spent 3 days adding traces and understanding how LWIP works, and then @david-cermak comes along and shoots from the hip a working patch.
Thanks!
I am building a Wifi Extender with LWIP/NAPT. I am using a Olimex PoE board with ESP32. I can get the board to use both the Wired Ethernet (Static IP) and Wifi (Station mode). The idea is to build a PoE Wifi booster that will connect to a Wifi network, and use NAPT to forward traffic with the Wired interface. If I setup my Wifi adapter in both Station and AP mode, LWIP/NAPT forwards traffic correctly. But I am experiencing problems when trying to forward traffic between the Wifi adapter and the Wired Ethernet adapter.
The test command I use
Using Wireshark, I see the SYN packet come in on ServerWifi, then the ACK packet goes from ServerWifi to ESP32Wifi. But then ESP32Wifi returns a RST packet (Connection Reset) instead of forwarding the packet to ESP32Wired.
I turned on traces in LWIP and I see the PCB to be empty. I am not very familiar with LWIP, but I suspect the active PCB should contain something.
Here is a sample of the relevant traces;