Hey,
On Tue, Jun 30, 2009 at 4:09 PM, Alex Shulgin
<alexander.shulgin@...> wrote:
Alex Shulgin wrote:
Alex Shulgin wrote:
Hi,
In the current version System.Net.NetworkInformation.NetworkInterface provides limited information about network interfaces on the system (their names only).
The attached patch adds support for NetworkInterfaceType and GetPhysicalAddress() on Mac OS.
Oops, I've almost forgot about IPv6... and missed the added file MacOsNetworkInterfaceMarshal.
Please see the fixed patch instead.
This worked fine, until one user reported a crash on Array.Copy in NetworkInformation.MacOsNetworkInterface.ImplGetAllNetworkInterfaces(). I traced this down to that I believe is a problem with non-standard length interface name: thus the 12-byte buffer sockaddr_dl.sdl_data is not enough.
I've noticed that sockaddr_dl contains sdl_len member which holds the length of the whole sockaddr structure. With that we can use Marshal.Copy instead of Array.Copy to access data past default 12-byte data array. A patch against trunk is attached.
I didn't have a chance to try it with the problematic user, but still would like someone to review the patch and comment on it.
--
Alex
PS: is there more appropriate way to increment IntPtr value w/o using ToInt64()?
You could use a loop and Marshal.ReadByte (IntPtr ptr, int offset);
Alan.
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@...
http://lists.ximian.com/mailman/listinfo/mono-devel-list
_______________________________________________
Mono-osx mailing list
Mono-osx@...
http://lists.ximian.com/mailman/listinfo/mono-osx