We have ported a working app, originally based on FreeRTOS 9.0 and TCP 2.0.1 to the latest TCP 2.0.7.
For simplicity reasons, we decided to upgrade only the TCP stack to the latest version and not the kernel.
The stack seem to work fine so far with the exception of LMNR. The device advertises correctly the device name when scanned externally but it doesn’t seem to respond to any LMNR packets.
The previous version using TCP 2.0.1 used to respond perfectly to both browser requests (http://devicename/) and ping (ping devicename).
Following the suggestion in a similar question in another thread I increased the ipconfigDNS_CACHE_NAME_LENGTH to 128 although the used name is just 7 characters long with no effect as expected.
Tracing the code I can see the network descriptors arriving in ulDNSHandlePacket() when an LMNR request is issued, but :
pxNetworkBuffer->xDataLength in ulDNSHandlePacket is usually 25 when an LMNR packet arrives (but the same applies for the working version 2.0.1).
The calculation of xPlayloadBufferLength = pxNetworkBuffer->xDataLength - sizeof( UDPPacket_t ) gives a result in the range of 0xFFFFFFEF (FreeRTOS_DNS.c line ~816 ).
Is never satisfied since UDPPacket_t is 42 Bytes long so prvParseDNSReply() is never executed.
The intension of the above calculations are not so clear to me so far but probably I am missing something.
Can you see any possible reasons for that ? Are there any known issues regarding LMNR in 2.0.7 or I am just missing something ?
xPlayloadBufferLength = pxNetworkBuffer->xDataLength - sizeof( UDPPacket_t );
in FreeRTOS_DNS.c line 816 is subtracting the size of the UDPPacket which is already subtracted earlier in prvProcessIPPacket() in the line :
if ( pxNetworkBuffer->xDataLength >= sizeof( UDPPacket_t ) )
{
pxNetworkBuffer->xDataLength -= sizeof( UDPPacket_t );
… }
Also the comparison :
if( pxNetworkBuffer->xDataLength > sizeof( UDPPacket_t ) )
can’t be true anymore so I commented out this line.
So the function simplifies to :