This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 52e67d167ae net/route: need clear old cached route info when do reset 
cache
52e67d167ae is described below

commit 52e67d167ae212aac41bbaa17b9684e64352b007
Author: shichunma <[email protected]>
AuthorDate: Sat Jan 10 14:19:36 2026 +0800

    net/route: need clear old cached route info when do reset cache
    
    When do net_flushcache_ip4/6, it may have old info at that time.
    
    Signed-off-by: Jerry Ma <[email protected]>
---
 net/route/net_cacheroute.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/route/net_cacheroute.c b/net/route/net_cacheroute.c
index 4ca6f13702d..4819a621f1b 100644
--- a/net/route/net_cacheroute.c
+++ b/net/route/net_cacheroute.c
@@ -400,6 +400,7 @@ static void net_reset_ipv4_cache(void)
 
   for (i = 0; i < CONFIG_ROUTE_MAX_IPv4_CACHEROUTES; i++)
     {
+      memset(&g_prealloc_ipv4cache[i], 0, sizeof(g_prealloc_ipv4cache[i]));
       net_add_newest_ipv4(&g_prealloc_ipv4cache[i]);
     }
 }
@@ -417,6 +418,7 @@ static void net_reset_ipv6_cache(void)
 
   for (i = 0; i < CONFIG_ROUTE_MAX_IPv6_CACHEROUTES; i++)
     {
+      memset(&g_prealloc_ipv6cache[i], 0, sizeof(g_prealloc_ipv6cache[i]));
       net_add_newest_ipv6(&g_prealloc_ipv6cache[i]);
     }
 }

Reply via email to