From 7455a699c40cf9ffa2c83dc4374fe618b2f3b06a Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Thu, 21 Jan 2016 12:36:58 +0000 Subject: [PATCH] Use more chars from endpointID to reduce clashes --- plugin/net/driver.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/net/driver.go b/plugin/net/driver.go index 5994c268..df0c2496 100644 --- a/plugin/net/driver.go +++ b/plugin/net/driver.go @@ -79,7 +79,7 @@ func (driver *driver) CreateEndpoint(create *api.CreateEndpointRequest) (*api.Cr if create.Interface == nil { return nil, fmt.Errorf("Not supported: creating an interface from within CreateEndpoint") } - // create veths. note we assume endpoint IDs are unique in the first 5 chars + // create veths. note we assume endpoint IDs are unique in the first 8 chars local := vethPair(endID) if err := netlink.LinkAdd(local); err != nil { return nil, errorf("could not create veth pair: %s", err) @@ -205,7 +205,7 @@ func (driver *driver) DiscoverDelete(disco *api.DiscoveryNotification) error { // === func vethPair(endpointID string) *netlink.Veth { - suffix := endpointID[:5] + suffix := endpointID[:8] return &netlink.Veth{ LinkAttrs: netlink.LinkAttrs{Name: "vethwl" + suffix}, PeerName: "vethwg" + suffix,