diff options
-rwxr-xr-x | kokoro/run_tests.sh | 4 | ||||
-rw-r--r-- | runsc/boot/network.go | 24 | ||||
-rw-r--r-- | runsc/sandbox/network.go | 1 |
3 files changed, 8 insertions, 21 deletions
diff --git a/kokoro/run_tests.sh b/kokoro/run_tests.sh index 9d630362e..b3f333f2f 100755 --- a/kokoro/run_tests.sh +++ b/kokoro/run_tests.sh @@ -153,10 +153,6 @@ run_docker_tests() { # configuration, e.g. save/restore not supported with hostnet. declare -a variations=("" "-kvm" "-hostnet" "-overlay") for v in "${variations[@]}"; do - # FIXME(b/132073574): we need to flush arp tables, otherwise tests fail with - # timeout. - sudo ip neigh show - sudo ip neigh flush dev docker0 # Run runsc tests with docker that are tagged manual. bazel test \ "${BAZEL_BUILD_FLAGS[@]}" \ diff --git a/runsc/boot/network.go b/runsc/boot/network.go index 598ec969e..0a154d90b 100644 --- a/runsc/boot/network.go +++ b/runsc/boot/network.go @@ -16,7 +16,6 @@ package boot import ( "fmt" - "math/rand" "net" "syscall" @@ -52,11 +51,12 @@ type DefaultRoute struct { // FDBasedLink configures an fd-based link. type FDBasedLink struct { - Name string - MTU int - Addresses []net.IP - Routes []Route - GSOMaxSize uint32 + Name string + MTU int + Addresses []net.IP + Routes []Route + GSOMaxSize uint32 + LinkAddress []byte } // LoopbackLink configures a loopback li nk. @@ -134,7 +134,7 @@ func (n *Network) CreateLinksAndRoutes(args *CreateLinksAndRoutesArgs, _ *struct return fmt.Errorf("failed to dup FD %v: %v", oldFD, err) } - mac := tcpip.LinkAddress(generateRndMac()) + mac := tcpip.LinkAddress(link.LinkAddress) linkEP, err := fdbased.New(&fdbased.Options{ FD: newFD, MTU: uint32(link.MTU), @@ -220,13 +220,3 @@ func ipToAddressMask(ip net.IP) tcpip.AddressMask { _, addr := ipToAddressAndProto(ip) return tcpip.AddressMask(addr) } - -// generateRndMac returns a random local MAC address. -// Copied from eth_random_addr() (include/linux/etherdevice.h) -func generateRndMac() net.HardwareAddr { - mac := make(net.HardwareAddr, 6) - rand.Read(mac) - mac[0] &^= 0x1 // clear multicast bit - mac[0] |= 0x2 // set local assignment bit (IEEE802) - return mac -} diff --git a/runsc/sandbox/network.go b/runsc/sandbox/network.go index 2a68d7043..0460d5f1a 100644 --- a/runsc/sandbox/network.go +++ b/runsc/sandbox/network.go @@ -246,6 +246,7 @@ func createInterfacesAndRoutesFromNS(conn *urpc.Client, nsPath string, enableGSO if err != nil { return fmt.Errorf("getting link for interface %q: %v", iface.Name, err) } + link.LinkAddress = []byte(ifaceLink.Attrs().HardwareAddr) if enableGSO { gso, err := isGSOEnabled(fd, iface.Name) |