summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/stack/stack_test.go
diff options
context:
space:
mode:
authorBert Muthalaly <stijlist@google.com>2020-01-08 09:28:53 -0800
committergVisor bot <gvisor-bot@google.com>2020-01-08 09:30:20 -0800
commit0cc1e74b57e539e66c1a421c047a08635c0008e8 (patch)
tree512d35ea510b991331879f9bb825e08681b6ede9 /pkg/tcpip/stack/stack_test.go
parenta53ac7307abfeb7172e67f48d0a7aaa4b5c3f31e (diff)
Add NIC.isLoopback()
...enabling us to remove the "CreateNamedLoopbackNIC" variant of CreateNIC and all the plumbing to connect it through to where the value is read in FindRoute. PiperOrigin-RevId: 288713093
Diffstat (limited to 'pkg/tcpip/stack/stack_test.go')
-rw-r--r--pkg/tcpip/stack/stack_test.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/tcpip/stack/stack_test.go b/pkg/tcpip/stack/stack_test.go
index d970a4abb..bf057745e 100644
--- a/pkg/tcpip/stack/stack_test.go
+++ b/pkg/tcpip/stack/stack_test.go
@@ -32,6 +32,7 @@ import (
"gvisor.dev/gvisor/pkg/tcpip/buffer"
"gvisor.dev/gvisor/pkg/tcpip/header"
"gvisor.dev/gvisor/pkg/tcpip/link/channel"
+ "gvisor.dev/gvisor/pkg/tcpip/link/loopback"
"gvisor.dev/gvisor/pkg/tcpip/network/ipv6"
"gvisor.dev/gvisor/pkg/tcpip/stack"
)
@@ -2153,10 +2154,10 @@ func TestNoLinkLocalAutoGenForLoopbackNIC(t *testing.T) {
OpaqueIIDOpts: test.opaqueIIDOpts,
}
- e := channel.New(0, 1280, linkAddr1)
+ e := loopback.New()
s := stack.New(opts)
- if err := s.CreateNamedLoopbackNIC(nicID, nicName, e); err != nil {
- t.Fatalf("CreateNamedLoopbackNIC(%d, %q, _) = %s", nicID, nicName, err)
+ if err := s.CreateNamedNIC(nicID, nicName, e); err != nil {
+ t.Fatalf("CreateNamedNIC(%d, %q, _) = %s", nicID, nicName, err)
}
addr, err := s.GetMainNICAddress(nicID, header.IPv6ProtocolNumber)