Skip to content

Commit

Permalink
routecache fails when the cache is full
Browse files Browse the repository at this point in the history
When the cache is full, route cache erase the last entry from it.
The simple way of doing it correctly is with pop_back.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
  • Loading branch information
amnonh authored and Pekka Enberg committed Oct 1, 2014
1 parent 697943f commit c9129ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bsd/sys/net/routecache.hh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class silly_rtable {
public:
void add(u32 a, u32 n, const nonlockable_rtentry &r) {
while (entries.size() >= max_entries) {
entries.erase(entries.end());
entries.pop_back();
}
entries.emplace_front(a, n, r);
}
Expand Down

0 comments on commit c9129ee

Please sign in to comment.