[BUG] `ipconfigDHCP_FALL_BACK_AUTO_IP` does not perform ARP clash detection
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- c
- Domain
- embedded-iot, networking
Research direction
Start in the link-local fallback path: prvPrepareLinkLayerIPLookUp chooses the candidate address, and vARPSendGratuitous is the ARP claim that is sent before the network stack is up. Check whether the claim is actually transmitted during IP acquisition, and why it is not. Done means a clashing address is detected during acquisition, a new link-local address is chosen, and the device keeps it; reproduce with the clash patch described in the report on a board with no DHCP server.
Written by the indexing model from the issue text.
Description
Describe the bug
When automatically getting a link local IP, the stack is supposed to detect if somebody is already using the randomly chosen address.
It does this by issuing a gratuitous ARP claim, and seeing if it gets responded to.
The code attempts to do this, but it doesn't work. Because the network stack is not up yet, vARPSendGratuitous does not lead to any message being sent. Therefore there's no reply, and no clash is detected. The network stack comes up on a conflicted address.
Target
STM32H7
Arm Cortex M
GCC 15.2
To Reproduce
In order to reliably get a clash on the randomly chosen link local address, you'll need to modify prvPrepareLinkLayerIPLookUp to generate a clashing address on purpose.
I used the following patch:
void prvPrepareLinkLayerIPLookUp( NetworkEndPoint_t * pxEndPoint )
{
uint8_t ucLinkLayerIPAddress[ 2 ];
uint32_t ulNumbers[ 2 ];
static uint32_t generate_n_clashes = 1;
/* After DHCP has failed to answer, prepare everything to start
* trying-out LinkLayer IP-addresses, using the random method. */
EP_DHCPData.xDHCPTxTime = xTaskGetTickCount();
( void ) xApplicationGetRandomNumber( &( ulNumbers[ 0 ] ) );
( void ) xApplicationGetRandomNumber( &( ulNumbers[ 1 ] ) );
ucLinkLayerIPAddress[ 0 ] = ( uint8_t ) ( 1 + ( ulNumbers[ 0 ] % 0xFDU ) ); /* get value 1..254 for IP-address 3rd byte of IP address to try. */
ucLinkLayerIPAddress[ 1 ] = ( uint8_t ) ( 1 + ( ulNumbers[ 1 ] % 0xFDU ) ); /* get value 1..254 for IP-address 4th byte of IP address to try. */
if (generate_n_clashes) {
ucLinkLayerIPAddress[0] = 131;
ucLinkLayerIPAddress[1] = 160;
generate_n_clashes--;
}
/* rest snipped */
}
- Connect to a network with no DHCP server, and make sure
ipconfigDHCP_FALL_BACK_AUTO_IPis set - Wait for the DHCP attempts to timeout, then watch for ARP resolution
Expected behavior
- The device should sent an ARP announcement for the clashing IP
- The clashing host will send a duplicate IP detected ARP message
- The device should pick a new link local IP, and send an ARP announcement for it
- This IP should stick
Current behaviour
- The device sends no ARP announcement during IP acquisition
- Once the stack is "up", ARP announcements start going out for the clashed address
- Despite the clashing host sending duplicate IP detected ARP messages, the device never changes IP
- Dominant language
- C
- Stars
- 215
- Forks
- 222
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from FreeRTOS/FreeRTOS-Plus-TCP
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 63/100
FreeRTOS/FreeRTOS-Plus-TCP#1395 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 95/100
FreeRTOS/FreeRTOS-Plus-TCP#1389 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
FreeRTOS/FreeRTOS-Plus-TCP#1388 ·
-
[BUG] PhyHandling incorrectly lists LAN8742A as having 19 PHYCRPossibly taken @StitchLilo626 claimed this 41 days ago. Openbug
Difficulty 1/5 Under an hour Newbie friendliness 78/100
FreeRTOS/FreeRTOS-Plus-TCP#1361 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 66/100
FreeRTOS/FreeRTOS-Plus-TCP#1392 · 1 comment ·
All issues in FreeRTOS/FreeRTOS-Plus-TCP
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
shinyquagsire23/OpenJKDF2#540 ·
Maintainers usually reply within 12 days
-
Prison work hall: laundry and kitchen stations stand at bare walls, the hatch has no counter or signOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Life-Framework/Life-Framework#5939 ·
Maintainers usually reply within 1 day
-
autoconf failes to find libsodium even when present due to implicit function declarationPossibly taken @coderjoe claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 13 days
-
Bug Status: Needs Triage
Difficulty 1/5 Under an hour Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
bug python
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
Jstar269/nakagawa-recomp#3521 ·
Maintainers usually reply within 1 day