software/libnet/microudp: speed-up ARP by changing timeout/tries

First ARP request does not seem to be transmitted (the link is probably not
fully established). Reduce the timeout between tries and increase number of
tries.
This commit is contained in:
Florent Kermarrec 2019-04-24 09:55:41 +02:00
parent 3ee78a5b70
commit 44e0cdda9a
1 changed files with 2 additions and 2 deletions

View File

@ -219,7 +219,7 @@ int microudp_arp_resolve(unsigned int ip)
for(i=0;i<6;i++) for(i=0;i<6;i++)
cached_mac[i] = 0; cached_mac[i] = 0;
for(tries=0;tries<5;tries++) { for(tries=0;tries<100;tries++) {
/* Send an ARP request */ /* Send an ARP request */
fill_eth_header(&txbuffer->frame.eth_header, fill_eth_header(&txbuffer->frame.eth_header,
broadcast, broadcast,
@ -242,7 +242,7 @@ int microudp_arp_resolve(unsigned int ip)
send_packet(); send_packet();
/* Do we get a reply ? */ /* Do we get a reply ? */
for(timeout=0;timeout<2000000;timeout++) { for(timeout=0;timeout<100000;timeout++) {
microudp_service(); microudp_service();
for(i=0;i<6;i++) for(i=0;i<6;i++)
if(cached_mac[i]) return 1; if(cached_mac[i]) return 1;