Fix/enable UDP packet reassembly by szekelyisz · Pull Request #7036 · esp8266/Arduino (original) (raw)
Thanks @d-a-v! Yeah I scratched my head a little because I found out in the meantime that reassembly is completely disabled in the LwIP 1.4 binary (although the feature is present in the source). Still I chose this approach for two reasons. First, having #if
s around every reference of pbuf->tot_len
or pbuf->len
is ugly. Second, someone could choose to recompile LwIP 1.4 with reassembly support, and it would be impolite to leave them with the original bug intentionally.
I came across this bug when I wanted to send data for WS2812 LED strips encoded in OSC packets as blobs. The usual MTU of 1500 bytes would leave me with around maximum 470 LEDs per strip, so I was wondering if I could use IP-level fragmentation to squeeze more data into a single datagram and avoid application-level fragmentation/reassembly. After making sure that LwIP had this feature and worked correctly I realized the bug was in the Arduino code. Now I can receive data for thousands of LEDs.