From 373c2459ff8e74bc7ab4e4ec20a07bb2f86160f8 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Fri, 16 Oct 2015 11:33:08 -0700 Subject: [PATCH 1/2] Fix build image name Signed-off-by: Alexander Morozov --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 40079bd..b1eabf5 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: all all-local build build-local check check-code check-format run-tests check-local integration-tests install-deps coveralls circle-ci start-services clean SHELL=/bin/bash -build_image=libnetwork-build +build_image=libnetworkbuild dockerargs = --privileged -v $(shell pwd):/go/src/github.com/docker/libnetwork -w /go/src/github.com/docker/libnetwork container_env = -e "INSIDECONTAINER=-incontainer=true" docker = docker run --rm -it ${dockerargs} ${container_env} ${build_image} From a815036c2fd730b909508c1fc0a89db030bafbf6 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Fri, 16 Oct 2015 11:33:17 -0700 Subject: [PATCH 2/2] Use netlink.LinkByName instead of net.InterfaceByName It's x350 time faster. Signed-off-by: Alexander Morozov --- netutils/utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netutils/utils.go b/netutils/utils.go index 7d90b1f..a1ead36 100644 --- a/netutils/utils.go +++ b/netutils/utils.go @@ -161,8 +161,8 @@ func GenerateIfaceName(prefix string, len int) (string, error) { if err != nil { continue } - if _, err := net.InterfaceByName(name); err != nil { - if strings.Contains(err.Error(), "no such") { + if _, err := netlink.LinkByName(name); err != nil { + if strings.Contains(err.Error(), "not found") { return name, nil } return "", err