lni._mtu = nii->Mtu;
lni._supportsMulticast = nii->SupportsMulticast != 0;
+ if (nii->NumAddressBytes > 0)
+ {
+ lni._physicalAddress = new PhysicalAddress(new ReadOnlySpan<byte>(nii->AddressBytes, nii->NumAddressBytes).ToArray());
+ }
+
interfaces[i] = lni;
interfacesByIndex.Add(nii->InterfaceIndex, lni);
nii++;
_log.WriteLine("SupportsMulticast: " + nic.SupportsMulticast);
_log.WriteLine("GetPhysicalAddress(): " + nic.GetPhysicalAddress());
+
+ if (nic.NetworkInterfaceType == NetworkInterfaceType.Ethernet)
+ {
+ Assert.Equal(6, nic.GetPhysicalAddress().GetAddressBytes().Length);
+ }
}
}
_log.WriteLine("SupportsMulticast: " + nic.SupportsMulticast);
_log.WriteLine("GetPhysicalAddress(): " + nic.GetPhysicalAddress());
+
+ if (nic.NetworkInterfaceType == NetworkInterfaceType.Ethernet)
+ {
+ Assert.Equal(6, nic.GetPhysicalAddress().GetAddressBytes().Length);
+ }
}
}
// Ethernet, WIFI and loopback should have known status.
Assert.True((nic.OperationalStatus == OperationalStatus.Up) || (nic.OperationalStatus == OperationalStatus.Down));
}
+
+ if (nic.NetworkInterfaceType == NetworkInterfaceType.Ethernet)
+ {
+ Assert.Equal(6, nic.GetPhysicalAddress().GetAddressBytes().Length);
+ }
}
}