private static int GetBestInterfaceForAddress(IPAddress addr)
        {
            int           index;
            SocketAddress address = new SocketAddress(addr);
            int           error   = (int)UnsafeNetInfoNativeMethods.GetBestInterfaceEx(address.m_Buffer, out index);

            if (error != 0)
            {
                throw new NetworkInformationException(error);
            }

            return(index);
        }