Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
6ccb9749
Commit
6ccb9749
authored
7 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
net/route: Fix an error in cache list management.
parent
152164dc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
net/route/net_cacheroute.c
+33
-33
33 additions, 33 deletions
net/route/net_cacheroute.c
with
33 additions
and
33 deletions
net/route/net_cacheroute.c
+
33
−
33
View file @
6ccb9749
...
...
@@ -577,24 +577,24 @@ int net_addcache_ipv4(FAR struct net_route_ipv4_s *route)
* list, then do nothing. It is already the most recently used.
*/
if
(
prev
==
NULL
)
{
net_unlock_ipv4_cache
();
return
OK
;
}
/* Otherwise, remove the cache entry from the
list */
if
(
g_ipv4_cache
.
tail
==
cache
)
{
g_ipv4_cache
.
tail
=
prev
;
}
else
{
prev
->
flink
=
cache
->
flink
;
}
cache
->
flink
=
NULL
;
if
(
prev
==
NULL
)
{
net_unlock_ipv4_cache
();
return
OK
;
}
/* Otherwise, remove the cache entry from the
middle or end of
* the list.
*/
prev
->
flink
=
cache
->
flink
;
if
(
g_ipv4_cache
.
tail
==
cache
)
{
g_ipv4_cache
.
tail
=
prev
;
}
cache
->
flink
=
NULL
;
break
;
}
}
...
...
@@ -657,24 +657,24 @@ int net_addcache_ipv6(FAR struct net_route_ipv6_s *route)
* list, then do nothing. It is already the most recently used.
*/
if
(
prev
==
NULL
)
{
net_unlock_ipv6_cache
();
return
OK
;
}
if
(
prev
==
NULL
)
{
net_unlock_ipv6_cache
();
return
OK
;
}
/* Otherwise, remove the cache entry from the list */
/* Otherwise, remove the cache entry from the middle or end of
* the list.
*/
if
(
g_ipv6_cache
.
tail
==
cache
)
{
g_ipv6_cache
.
tail
=
prev
;
}
else
{
prev
->
flink
=
cache
->
flink
;
}
prev
->
flink
=
cache
->
flink
;
if
(
g_ipv6_cache
.
tail
==
cache
)
{
g_ipv6_cache
.
tail
=
prev
;
}
cache
->
flink
=
NULL
;
cache
->
flink
=
NULL
;
break
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment