When getting the prefix length of an IP address from the Windows IP_ADAPTER_PREFIX structure, the current implementation of NetworkInterface is incorrectly using the Length field, which contains the size of the structure itself, instead of the PrefixLength field. This bug only affects builds for Windows XP and Server 2003, since NetworkInterface correctly gets the prefix length from a different structure on newer versions of Windows. It causes incorrect results on 32-bit builds and a runtime assertion violation on 64-bit builds (where the size of the IP_ADAPTER_PREFIX structure is larger than the maximum prefix length of an IPv4 address).
Reference:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa366065(v=vs.85).aspx