mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Clean up the dummy network interface used by UDP tests
It is now composed by a NetworkInterface interface which lets us delete the methods we don't need. PiperOrigin-RevId: 351613267
This commit is contained in:
@@ -1560,33 +1560,17 @@ func TestNoChecksum(t *testing.T) {
|
|||||||
var _ stack.NetworkInterface = (*testInterface)(nil)
|
var _ stack.NetworkInterface = (*testInterface)(nil)
|
||||||
|
|
||||||
type testInterface struct {
|
type testInterface struct {
|
||||||
stack.NetworkLinkEndpoint
|
stack.NetworkInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*testInterface) ID() tcpip.NICID {
|
func (*testInterface) ID() tcpip.NICID {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*testInterface) IsLoopback() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*testInterface) Name() string {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*testInterface) Enabled() bool {
|
func (*testInterface) Enabled() bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*testInterface) Promiscuous() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*testInterface) WritePacketToRemote(tcpip.LinkAddress, *stack.GSO, tcpip.NetworkProtocolNumber, *stack.PacketBuffer) *tcpip.Error {
|
|
||||||
return tcpip.ErrNotSupported
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestTTL(t *testing.T) {
|
func TestTTL(t *testing.T) {
|
||||||
for _, flow := range []testFlow{unicastV4, unicastV4in6, unicastV6, unicastV6Only, multicastV4, multicastV4in6, multicastV6, broadcast, broadcastIn6} {
|
for _, flow := range []testFlow{unicastV4, unicastV4in6, unicastV6, unicastV6Only, multicastV4, multicastV4in6, multicastV6, broadcast, broadcastIn6} {
|
||||||
t.Run(fmt.Sprintf("flow:%s", flow), func(t *testing.T) {
|
t.Run(fmt.Sprintf("flow:%s", flow), func(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user