From fb65b0b471621b430969fe1c3009bee68209bf67 Mon Sep 17 00:00:00 2001 From: Googler Date: Fri, 28 Sep 2018 12:16:47 -0700 Subject: Change tcpip.Route.Mask to tcpip.AddressMask. PiperOrigin-RevId: 214975659 Change-Id: I7bd31a2c54f03ff52203109da312e4206701c44c --- pkg/tcpip/adapters/gonet/gonet_test.go | 4 ++-- pkg/tcpip/network/ipv6/icmp_test.go | 4 ++-- pkg/tcpip/sample/tun_tcp_echo/main.go | 2 +- pkg/tcpip/tcpip.go | 2 +- pkg/tcpip/tcpip_test.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'pkg/tcpip') diff --git a/pkg/tcpip/adapters/gonet/gonet_test.go b/pkg/tcpip/adapters/gonet/gonet_test.go index 86a82f21d..79b7c77ee 100644 --- a/pkg/tcpip/adapters/gonet/gonet_test.go +++ b/pkg/tcpip/adapters/gonet/gonet_test.go @@ -68,7 +68,7 @@ func newLoopbackStack() (*stack.Stack, *tcpip.Error) { // IPv4 { Destination: tcpip.Address(strings.Repeat("\x00", 4)), - Mask: tcpip.Address(strings.Repeat("\x00", 4)), + Mask: tcpip.AddressMask(strings.Repeat("\x00", 4)), Gateway: "", NIC: NICID, }, @@ -76,7 +76,7 @@ func newLoopbackStack() (*stack.Stack, *tcpip.Error) { // IPv6 { Destination: tcpip.Address(strings.Repeat("\x00", 16)), - Mask: tcpip.Address(strings.Repeat("\x00", 16)), + Mask: tcpip.AddressMask(strings.Repeat("\x00", 16)), Gateway: "", NIC: NICID, }, diff --git a/pkg/tcpip/network/ipv6/icmp_test.go b/pkg/tcpip/network/ipv6/icmp_test.go index b8e53c13e..fabbdc8c7 100644 --- a/pkg/tcpip/network/ipv6/icmp_test.go +++ b/pkg/tcpip/network/ipv6/icmp_test.go @@ -108,14 +108,14 @@ func newTestContext(t *testing.T) *testContext { c.s0.SetRouteTable( []tcpip.Route{{ Destination: lladdr1, - Mask: tcpip.Address(strings.Repeat("\xff", 16)), + Mask: tcpip.AddressMask(strings.Repeat("\xff", 16)), NIC: 1, }}, ) c.s1.SetRouteTable( []tcpip.Route{{ Destination: lladdr0, - Mask: tcpip.Address(strings.Repeat("\xff", 16)), + Mask: tcpip.AddressMask(strings.Repeat("\xff", 16)), NIC: 1, }}, ) diff --git a/pkg/tcpip/sample/tun_tcp_echo/main.go b/pkg/tcpip/sample/tun_tcp_echo/main.go index a4b28a7a3..910d1257f 100644 --- a/pkg/tcpip/sample/tun_tcp_echo/main.go +++ b/pkg/tcpip/sample/tun_tcp_echo/main.go @@ -150,7 +150,7 @@ func main() { s.SetRouteTable([]tcpip.Route{ { Destination: tcpip.Address(strings.Repeat("\x00", len(addr))), - Mask: tcpip.Address(strings.Repeat("\x00", len(addr))), + Mask: tcpip.AddressMask(strings.Repeat("\x00", len(addr))), Gateway: "", NIC: 1, }, diff --git a/pkg/tcpip/tcpip.go b/pkg/tcpip/tcpip.go index 5f210cdd0..f5b5ec86b 100644 --- a/pkg/tcpip/tcpip.go +++ b/pkg/tcpip/tcpip.go @@ -490,7 +490,7 @@ type Route struct { // Mask specifies which bits of the Destination and the target address // must match for this row to be viable. - Mask Address + Mask AddressMask // Gateway is the gateway to be used if this row is viable. Gateway Address diff --git a/pkg/tcpip/tcpip_test.go b/pkg/tcpip/tcpip_test.go index 9b20c74c6..d283f71c7 100644 --- a/pkg/tcpip/tcpip_test.go +++ b/pkg/tcpip/tcpip_test.go @@ -123,7 +123,7 @@ func TestSubnetCreation(t *testing.T) { func TestRouteMatch(t *testing.T) { tests := []struct { d Address - m Address + m AddressMask a Address want bool }{ -- cgit v1.2.3