summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-08-28 21:42:57 +0000
committergVisor bot <gvisor-bot@google.com>2020-08-28 21:42:57 +0000
commit8ea00f4541a0ec977d367837b8c752fddfbeadd4 (patch)
treeb0b65b731bb0727550343b090250a84df72b1a08 /pkg/tcpip
parent62daea73a85389e465e8b53a0dce9ac1f080e049 (diff)
parentd5787f628c40624db4d9d2a970f7e672bb006852 (diff)
Merge release-20200818.0-85-gd5787f628 (automated)
Diffstat (limited to 'pkg/tcpip')
-rw-r--r--pkg/tcpip/link/tun/tun_endpoint_refs.go2
-rw-r--r--pkg/tcpip/stack/nic.go6
2 files changed, 4 insertions, 4 deletions
diff --git a/pkg/tcpip/link/tun/tun_endpoint_refs.go b/pkg/tcpip/link/tun/tun_endpoint_refs.go
index e0595429c..7f80b1fa3 100644
--- a/pkg/tcpip/link/tun/tun_endpoint_refs.go
+++ b/pkg/tcpip/link/tun/tun_endpoint_refs.go
@@ -2,11 +2,11 @@ package tun
import (
"fmt"
+ refs_vfs1 "gvisor.dev/gvisor/pkg/refs"
"runtime"
"sync/atomic"
"gvisor.dev/gvisor/pkg/log"
- refs_vfs1 "gvisor.dev/gvisor/pkg/refs"
)
// ownerType is used to customize logging. Note that we use a pointer to T so
diff --git a/pkg/tcpip/stack/nic.go b/pkg/tcpip/stack/nic.go
index 8e700990d..863ef6bee 100644
--- a/pkg/tcpip/stack/nic.go
+++ b/pkg/tcpip/stack/nic.go
@@ -676,10 +676,10 @@ func (n *NIC) getRefOrCreateTemp(protocol tcpip.NetworkProtocolNumber, address t
}
// A usable reference was not found, create a temporary one if requested by
- // the caller or if the address is found in the NIC's subnets and the NIC is
- // a loopback interface.
+ // the caller or if the IPv4 address is found in the NIC's subnets and the NIC
+ // is a loopback interface.
createTempEP := spoofingOrPromiscuous
- if !createTempEP && n.isLoopback() {
+ if !createTempEP && n.isLoopback() && protocol == header.IPv4ProtocolNumber {
for _, r := range n.mu.endpoints {
addr := r.addrWithPrefix()
subnet := addr.Subnet()