Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
agent: network: Don't loop over a list being potentially modified
When the pod is destroyed, it removes all the routes and interfaces previously setup. The list of routes and interfaces is maintained by the agent, referring to list of pointers. When the agent tries to rely on this list to remove routes and interfaces, the list is updated by the code removing them, leading to weird situations where the loop does not properly go over the expected items of the list. This commit duplicates the list of routes and interfaces as non pointers, so that we make sure that any removal from the function UpdateRoute() or UpdateInterface() will not result in modifying the initial list being parsed. Fixes kata-containers#226 Signed-off-by: Sebastien Boeuf <[email protected]>
- Loading branch information