MCPcopy
hub / github.com/safing/portmaster / TestGetInterfaceByIP_LinkLocalIPv6

Function TestGetInterfaceByIP_LinkLocalIPv6

service/netenv/interfaces_test.go:268–276  ·  view source on GitHub ↗

TestGetInterfaceByIP_LinkLocalIPv6 verifies that IPv6 link-local addresses are filtered out of the cache and therefore never match a lookup.

(t *testing.T)

Source from the content-addressed store, hash-verified

266// TestGetInterfaceByIP_LinkLocalIPv6 verifies that IPv6 link-local addresses
267// are filtered out of the cache and therefore never match a lookup.
268func TestGetInterfaceByIP_LinkLocalIPv6(t *testing.T) {
269 t.Parallel()
270
271 ip := net.ParseIP("fe80::1")
272 _, err := GetInterfaceByIP(ip)
273 if err == nil {
274 t.Error("expected error for link-local IP fe80::1, got nil")
275 }
276}
277
278// TestGetInterfaceByIP_LinkLocalIPv4 verifies that IPv4 link-local addresses
279// (APIPA range 169.254.x.x) are filtered out of the cache.

Callers

nothing calls this directly

Calls 2

GetInterfaceByIPFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected