FreeRTOS-TCP arp reply length incorrect

This is a follow-up topic to a related problem I reecently had. See https://sourceforge.net/p/freertos/discussion/382005/thread/0d4d999eab/?limit=25 The problem is that the length of the arp reply packet is not set before it is passed to the network interface layer. When an arp request is received, it is passed to xSendEventStructToIPTask. From there it is passed to prvProcessEthernetPacket and ends up in eARPProcessPacket. The arp reply packet is then generated by reusing buffer from the arp request. When done, the arp reply is sent to the network interface function vReturnEthernetFrame for transmission. So far so good. The function prvProcessEthernetPacket checks that the packet length is greater than the size of an arp packet, but otherwise the packet length is not modified. In my setup, the arp packet received by the embedded code has been padded (presumably by the Windows 10 computer) and has a FCS (CRC). Since the reply length has not been set, the returned arp reply has an out-of-date padding and FCS that render the transmitted Ethernet packet invalid. I think that the reply length needs to be set in prvProcessEthernetPacket after the call to eARPProcessPacket. Is my analysis correct?

FreeRTOS-TCP arp reply length incorrect

You could be right. Did you try to make a patch for it and see if it is correct?

FreeRTOS-TCP arp reply length incorrect

I patched the function prvProcessEthernetPacket as follows:
    case ipARP_FRAME_TYPE:
        /* The Ethernet frame contains an ARP packet. */
        if( pxNetworkBuffer->xDataLength >= sizeof( ARPPacket_t ) )
        {
            eReturned = eARPProcessPacket( ( ARPPacket_t * )pxNetworkBuffer->pucEthernetBuffer );
            pxNetworkBuffer->xDataLength = sizeof( ARPPacket_t ); /* NEW CODE */
        }
        else
        {
            eReturned = eReleaseBuffer;
        }
        break;
I no longer get FCS errors reported in Wireshark, so it looks better. I have some remaining problems with my network interface driver, but this is a step forards.