mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #546 from tomdee/endpoint_locking
Remove unwanted lock
This commit is contained in:
commit
ef732a9dce
1 changed files with 1 additions and 12 deletions
|
@ -203,22 +203,11 @@ func (ep *endpoint) AddStaticRoute(destination *net.IPNet, routeType int, nextHo
|
|||
ep.joinInfo.StaticRoutes = append(ep.joinInfo.StaticRoutes, &r)
|
||||
} else {
|
||||
// If the route doesn't specify a next-hop, it must be a connected route, bound to an interface.
|
||||
if err := ep.addInterfaceRoute(&r); err != nil {
|
||||
return err
|
||||
}
|
||||
ep.iface.routes = append(ep.iface.routes, r.Destination)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ep *endpoint) addInterfaceRoute(route *types.StaticRoute) error {
|
||||
ep.Lock()
|
||||
defer ep.Unlock()
|
||||
|
||||
iface := ep.iface
|
||||
iface.routes = append(iface.routes, route.Destination)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ep *endpoint) Sandbox() Sandbox {
|
||||
cnt, ok := ep.getSandbox()
|
||||
if !ok {
|
||||
|
|
Loading…
Add table
Reference in a new issue