# FreeRTOS+TCP\_Multi Bug: ARP resolves remote addresses locally

**URL:** <https://forums.freertos.org/t/freertos-tcp-multi-bug-arp-resolves-remote-addresses-locally/6739>\
**Category:** Kernel\
**Created:** [August 11, 2017, 3:46pm UTC](https://forums.freertos.org/t/freertos-tcp-multi-bug-arp-resolves-remote-addresses-locally/6739 "2017-08-11T15:46:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 11, 2017, 3:46pm UTC](https://forums.freertos.org/t/freertos-tcp-multi-bug-arp-resolves-remote-addresses-locally/6739/1 "2017-08-11T15:46:52Z")

</div>

**[miclam](https://sourceforge.net/u/miclam/)** wrote on [Friday, August 11, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/8d74640f/#cc03):

Hello,

I’m currently testing the DNS client of +TCP\_multi. When using 8.8.8.8 as DNS server I noticed, that eARPGetCacheEntry does not resolve unmatched remote ip addresses to the default gateway.  
This is because FreeRTOS\_FindEndPointOnNetMask returns either the correct EndPoint, or the default EndPoint, and only in case no default is set NULL.  
eARPGetCacheEntry then checks by `if( pxEndPoint == NULL )` (Line 456 in FreeRTOS\_ARP.c) if the default gateway should be used, which is never reached.

My idea was to let FreeRTOS\_FindEndPointOnNetMask return NULL instead of the default EndPoint, and to explicitly call FreeRTOS\_FindDefaultEndPoint wherever the default EndPoint is required. But FreeRTOS\_FindEndPointOnNetMask is used in quiet a lot locations, I’m afraid of breaking something without knowing.

What do you think?

Many thanks,  
Michael

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 11, 2017, 4:25pm UTC](https://forums.freertos.org/t/freertos-tcp-multi-bug-arp-resolves-remote-addresses-locally/6739/2 "2017-08-11T16:25:30Z")

</div>

**[miclam](https://sourceforge.net/u/miclam/)** wrote on [Friday, August 11, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/8d74640f/#dab3):

Hello,  
as far as I can see commenting out `pxEndPoint = pxDefault;` in Line 375 in FreeRTOS\_Routing.c and changing Line 2655 in FreeRTOS\_IP.c and Line 195 in FreeRTOS\_UDP\_IP.c to

```
        pxNetworkBuffer->pxEndPoint = FreeRTOS_FindEndPointOnNetMask( pxIPPacket->xIPHeader.ulDestinationIPAddress, 7 );
        /* _ML_ Removed default EndPoint from FreeRTOS_FindEndPointOnNetMask, so get it here if needed. */
        if( pxNetworkBuffer->pxEndPoint == NULL )
        {
            pxNetworkBuffer->pxEndPoint = FreeRTOS_FindDefaultEndPoint();
        }

```

works. The other occurences of FreeRTOS\_FindEndPointOnNetMask seem to actually expect it not to return the default gateway.

Regards,  
Michael

---

<div class="post-metadata">

**Author:** ![htibosch](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/htibosch/32/62_2.png) [@htibosch](https://forums.freertos.org/u/htibosch)\
**Post date:** [August 11, 2017, 6:46pm UTC](https://forums.freertos.org/t/freertos-tcp-multi-bug-arp-resolves-remote-addresses-locally/6739/3 "2017-08-11T18:46:02Z")

</div>

**[heinbali01](https://sourceforge.net/u/heinbali01/)** wrote on [Friday, August 11, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/8d74640f/#e59c):

See my reponse [here](https://sourceforge.net/p/freertos/discussion/382005/thread/32811b1b/?limit=25#4996)
