summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/stack/nic_test.go
diff options
context:
space:
mode:
authorGhanan Gowripalan <ghanan@google.com>2021-01-30 11:35:35 -0800
committergVisor bot <gvisor-bot@google.com>2021-01-30 11:37:29 -0800
commit2d90bc54809766927e6028fac5b9f67cd2a13c3e (patch)
tree905a197ce947003d406b880fc1d096c60de0d342 /pkg/tcpip/stack/nic_test.go
parent825c185dc56251bd330124ef773c6653e3887579 (diff)
Implement LinkAddressResolver on NetworkEndpoints
This removes the need to provide the link address request with the NIC the request is being performed on since the NetworkEndpoints already have a reference to the NIC. PiperOrigin-RevId: 354721940
Diffstat (limited to 'pkg/tcpip/stack/nic_test.go')
-rw-r--r--pkg/tcpip/stack/nic_test.go20
1 files changed, 0 insertions, 20 deletions
diff --git a/pkg/tcpip/stack/nic_test.go b/pkg/tcpip/stack/nic_test.go
index 2f719fbe5..3564202d8 100644
--- a/pkg/tcpip/stack/nic_test.go
+++ b/pkg/tcpip/stack/nic_test.go
@@ -111,8 +111,6 @@ type testIPv6EndpointStats struct{}
// IsNetworkEndpointStats implements stack.NetworkEndpointStats.
func (*testIPv6EndpointStats) IsNetworkEndpointStats() {}
-var _ LinkAddressResolver = (*testIPv6Protocol)(nil)
-
// We use this instead of ipv6.protocol because the ipv6 package depends on
// the stack package which this test lives in, causing a cyclic dependency.
type testIPv6Protocol struct{}
@@ -169,24 +167,6 @@ func (*testIPv6Protocol) Parse(*PacketBuffer) (tcpip.TransportProtocolNumber, bo
return 0, false, false
}
-// LinkAddressProtocol implements LinkAddressResolver.
-func (*testIPv6Protocol) LinkAddressProtocol() tcpip.NetworkProtocolNumber {
- return header.IPv6ProtocolNumber
-}
-
-// LinkAddressRequest implements LinkAddressResolver.
-func (*testIPv6Protocol) LinkAddressRequest(_, _ tcpip.Address, _ tcpip.LinkAddress, _ NetworkInterface) tcpip.Error {
- return nil
-}
-
-// ResolveStaticAddress implements LinkAddressResolver.
-func (*testIPv6Protocol) ResolveStaticAddress(addr tcpip.Address) (tcpip.LinkAddress, bool) {
- if header.IsV6MulticastAddress(addr) {
- return header.EthernetAddressFromMulticastIPv6Address(addr), true
- }
- return "", false
-}
-
func TestDisabledRxStatsWhenNICDisabled(t *testing.T) {
// When the NIC is disabled, the only field that matters is the stats field.
// This test is limited to stats counter checks.