I am using lwip raw api functions to perform tcp, udp message sending. I am
trying to implement dhcp as well using the raw api.
I posted earlier in the forum about getting malformed DHCP request packets
from my device. I was foxed since the only function I had called was
dhcp_start(&mynetif). I was able to successfully send a broadcast udp
message before this, however when the length of the message exceeded about
210 bytes the message seen in wireshark started appearing corrupted. No
issues when sending a message less than 210 bytes. I believe this may be the
origin of the DHCP malformed packet, since DHCP uses UDP send.
Please advise me what may be occurring to make UDP send fail in longer
I have ascertained that just before calling ip_output function, i.e.
netif->output(netif, p, dest), the length of the payload was 336 bytes but
what I see on wireshark is only 96 bytes, which is why the DHCP request is
coming out malformed - it is truncated. In fact, any UDP packet with a total length of more than 255 bytes is corrupted or truncated.
I have also successfully been able to send a TCP message to my PC and see the payload for a short message, but when I construct a longer message of about 250 bytes TCP retransmits for a while and then gives up. There seems to be a pattern here.
Issue resolved, issue was with the low-level ethernet driver, the length of
the packet was saved as a uint8_t instead of a larger integer so the largest
length that it could handle was 256 bytes. So far I had never encountered a
packet larger than that - hence it also fixed the malformed DHCPDiscover