[BUG] `ipconfigDHCP_FALL_BACK_AUTO_IP` does not perform ARP clash detection

Aperta
#1,341 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
c

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

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_IP is 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
Lingua principale
C
Stelle
215
Fork
222
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di FreeRTOS/FreeRTOS-Plus-TCP

Tutte le issue di FreeRTOS/FreeRTOS-Plus-TCP

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.