diff --git a/libnetwork/drivers/overlay/encryption.go b/libnetwork/drivers/overlay/encryption.go index e36fa0ff3a..ec8c4a8419 100644 --- a/libnetwork/drivers/overlay/encryption.go +++ b/libnetwork/drivers/overlay/encryption.go @@ -5,6 +5,7 @@ import ( "encoding/binary" "encoding/hex" "fmt" + "hash/fnv" "net" "sync" "syscall" @@ -353,13 +354,13 @@ func spExists(sp *netlink.XfrmPolicy) (bool, error) { } func buildSPI(src, dst net.IP, st uint32) int { - spi := int(st) - f := src[len(src)-4:] - t := dst[len(dst)-4:] - for i := 0; i < 4; i++ { - spi = spi ^ (int(f[i])^int(t[3-i]))<