anchao opened a new pull request, #20855:
URL: https://github.com/apache/nuttx/pull/20855

   ## Summary                                                                
                                                                             
   Cache the packet source and destination IPv4 addresses before walking the 
   IPv4 ipfilter rule chain.                                                 
                                                                             
   `ipv4_filter_match()` checks each filter entry in the selected chain for  
   a packet. The packet source and destination addresses do not change while 
   iterating over the rules, but the previous code converted both addresses  
   from the IPv4 header for each rule before doing the masked address        
   comparison.                                                               
                                                                             
   This change converts the source and destination addresses once before the 
   rule loop and reuses the cached values for every IPv4 rule.               
                                                                             
   ## Impact                                                                 
                                                                             
   - Avoids repeated IPv4 address conversion while matching a packet against 
     multiple filter rules.                                                  
   - Keeps the filter matching result unchanged.                             
   - Reduces small per-rule overhead on the IPv4 ipfilter matching path.     
   - IPv6 matching is unchanged.                                             
                                                                             
   ## Testing                                                                
   
   sim/tcpblaster and enable CONFIG_NET_IPFILTER


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to