Explorar o código

Remove unwanted lock

Fixes #545

Signed-off-by: Tom Denham <tom@tomdee.co.uk>
Tom Denham %!s(int64=9) %!d(string=hai) anos
pai
achega
3342e5591b
Modificáronse 1 ficheiros con 1 adicións e 12 borrados
  1. 1 12
      libnetwork/endpoint_info.go

+ 1 - 12
libnetwork/endpoint_info.go

@@ -203,22 +203,11 @@ func (ep *endpoint) AddStaticRoute(destination *net.IPNet, routeType int, nextHo
 		ep.joinInfo.StaticRoutes = append(ep.joinInfo.StaticRoutes, &r)
 		ep.joinInfo.StaticRoutes = append(ep.joinInfo.StaticRoutes, &r)
 	} else {
 	} else {
 		// If the route doesn't specify a next-hop, it must be a connected route, bound to an interface.
 		// 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
 	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 {
 func (ep *endpoint) Sandbox() Sandbox {
 	cnt, ok := ep.getSandbox()
 	cnt, ok := ep.getSandbox()
 	if !ok {
 	if !ok {