mirror of
https://github.com/apache/nuttx.git
synced 2026-05-10 15:30:25 +08:00
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 <masc2008@gmail.com>
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user