blob: b8940e718bdf3edf90f9da8923190d717f56144b [file] [log] [blame]
Andrew Walbran12f61402020-10-14 11:10:53 +01001use nix::net::if_::*;
2
3#[cfg(any(target_os = "android", target_os = "linux"))]
4const LOOPBACK: &[u8] = b"lo";
5
6#[cfg(not(any(target_os = "android", target_os = "linux")))]
7const LOOPBACK: &[u8] = b"lo0";
8
9#[test]
10fn test_if_nametoindex() {
11 assert!(if_nametoindex(&LOOPBACK[..]).is_ok());
12}