Skip to content

ARP: should drop any packet pended when timeout #8019

@qianfan-Zhao

Description

@qianfan-Zhao

Zephyr send ARP packet first before ICMP if the ip address doesn't cached in ip tables, always pended the ICMP packet and resend pended ICMP packet when it got ARP reply.

But if the ARP packet doesn't have a reply because host doesn't exist, zephyr will always hold on the ICMP packet pended, doesn't free !

There always has a ARP item in arp tables associate that ip address but mac address is zero even if that ARP packet doesn't has a reply.

Next is the log from zephyr's console shell, I try ping some nonexistent hosts:

net> ping 192.168.3.10                                                                           
Sent a ping to 192.168.3.10                                                                      
Ping timeout                                                                                     
net> arp                                                                                         
     Interface  Link              Address                                                        
[ 0] 0x2000dd60 00:00:00:00:00:00 192.168.3.10                                                   
net> mem                                                                                         
Fragment length 128 bytes                                                                        
Network buffer pools:                                                                            
Address         Total   Avail   Name                                                             
0x2000dc5c      32      32      RX                                                               
0x2000dc78      32      31      TX                                                               
0x2000dcf4      32      32      RX DATA (rx_bufs)                                                
0x2000dd1c      32      31      TX DATA (tx_bufs)                                                
net> ping 192.168.3.11                                                                           
Sent a ping to 192.168.3.11                                                                      
Ping timeout                                                                                     
net> arp                                                                                         
     Interface  Link              Address                                                        
[ 0] 0x2000dd60 00:00:00:00:00:00 192.168.3.10                                                   
[ 1] 0x2000dd60 00:00:00:00:00:00 192.168.3.11                                                   
net> mem                                                                                         
Fragment length 128 bytes                                                                        
Network buffer pools:                                                                            
Address         Total   Avail   Name                                                             
0x2000dc5c      32      32      RX                                                               
0x2000dc78      32      30      TX                                                               
0x2000dcf4      32      32      RX DATA (rx_bufs)                                                
0x2000dd1c      32      30      TX DATA (tx_bufs)                                                
net> ping 192.168.3.12                                                                           
Sent a ping to 192.168.3.12                                                                      
Ping timeout                                                                                     
net> arp                                                                                         
     Interface  Link              Address                                                        
[ 0] 0x2000dd60 00:00:00:00:00:00 192.168.3.10                                                   
[ 1] 0x2000dd60 00:00:00:00:00:00 192.168.3.11                                                   
[ 2] 0x2000dd60 00:00:00:00:00:00 192.168.3.12                                                   
net> mem                                                                                         
Fragment length 128 bytes                                                                        
Network buffer pools:                                                                            
Address         Total   Avail   Name                                                             
0x2000dc5c      32      32      RX                                                               
0x2000dc78      32      29      TX                                                               
0x2000dcf4      32      32      RX DATA (rx_bufs)                                                
0x2000dd1c      32      29      TX DATA (tx_bufs)                                                
net> ping 192.168.3.13                                                                           
Sent a ping to 192.168.3.13                                                                      
Ping timeout                                                                                     
net> arp                                                                                         
     Interface  Link              Address                                                        
[ 0] 0x2000dd60 00:00:00:00:00:00 192.168.3.10                                                   
[ 1] 0x2000dd60 00:00:00:00:00:00 192.168.3.11                                                   
[ 2] 0x2000dd60 00:00:00:00:00:00 192.168.3.12                                                   
[ 3] 0x2000dd60 00:00:00:00:00:00 192.168.3.13                                                   
net> mem                                                                                         
Fragment length 128 bytes                                                                        
Network buffer pools:                                                                            
Address         Total   Avail   Name                                                             
0x2000dc5c      32      32      RX                                                               
0x2000dc78      32      28      TX                                                               
0x2000dcf4      32      32      RX DATA (rx_bufs)                                                
0x2000dd1c      32      28      TX DATA (tx_bufs)                                                
net> ping 192.168.3.14                                                                           
Sent a ping to 192.168.3.14                                                                      
Ping timeout                                                                                     
net> arp                                                                                         
     Interface  Link              Address                                                        
[ 0] 0x2000dd60 00:00:00:00:00:00 192.168.3.10                                                   
[ 1] 0x2000dd60 00:00:00:00:00:00 192.168.3.11                                                   
[ 2] 0x2000dd60 00:00:00:00:00:00 192.168.3.12                                                   
[ 3] 0x2000dd60 00:00:00:00:00:00 192.168.3.13                                                   
[ 4] 0x2000dd60 00:00:00:00:00:00 192.168.3.14                                                   
net> mem                                                                                         
Fragment length 128 bytes                                                                        
Network buffer pools:                                                                            
Address         Total   Avail   Name                                                             
0x2000dc5c      32      32      RX                                                               
0x2000dc78      32      27      TX                                                               
0x2000dcf4      32      32      RX DATA (rx_bufs)                                                
0x2000dd1c      32      27      TX DATA (tx_bufs)                                                
net> 

There should resolve those problem:

  1. do NOT occupy one item in arp tables if that ARP doesn't has a reply
  2. free net packet pended before when ARP timeout

Metadata

Metadata

Assignees

Labels

area: NetworkingbugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions