TestGetInterfaceByIP_LinkLocalIPv4 verifies that IPv4 link-local addresses (APIPA range 169.254.x.x) are filtered out of the cache.
(t *testing.T)
| 278 | // TestGetInterfaceByIP_LinkLocalIPv4 verifies that IPv4 link-local addresses |
| 279 | // (APIPA range 169.254.x.x) are filtered out of the cache. |
| 280 | func TestGetInterfaceByIP_LinkLocalIPv4(t *testing.T) { |
| 281 | t.Parallel() |
| 282 | |
| 283 | ip := net.ParseIP("169.254.0.1") |
| 284 | _, err := GetInterfaceByIP(ip) |
| 285 | if err == nil { |
| 286 | t.Error("expected error for link-local IP 169.254.0.1, got nil") |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | // TestGetInterface_RepeatedCall verifies that repeated calls with the same |
| 291 | // argument succeed consistently (exercises the list cache path). |
nothing calls this directly
no test coverage detected