If we encounter such a device we assign it an empty name followed by index number, so that we can
put any number of such devices in the dictionary and report them to the user.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=21741
Added code to call Xamarin.Android internal implementation of getifaddrs/freeifaddrs to provide us
with the required information to fulfill the request.
Added a handful of Linux ARP hardware IDs which are considered to be tunnel devices and which may occur
on Android devices.
Part of fix for https://bugzilla.xamarin.com/show_bug.cgi?id=1969
- ADDED: Implemented NetworkInterface property "OperationalStatus" to be UP, in case the IFF_UP flag is set
- ADDED: Implemented NetworkInterface property "SupportsMulticast" to be true, in case the IFF_MULTICAST flag is set
This change is released under the MIT license.
The previous version used SCNetworkReachability
in C inside libMonoPosixHelper. This was less
than ideal and made it more problematic for
supporting iOS as it doesn't actually link
MPH in.
Rewrite using P/Invokes directly into the
SCNetworkReachability APIs for Mac OS X and
iOS.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=13642
for iOS and Mac OS X.
Refactor System.Net.NetworkingInformation in order
to support multiple "providers"; previously only
Linux was ever supported for this API.
This patch provides basic support for Mac OS X
via the SystemConfiguration framework's
SCNetworkReachability API.
bxc#12038
Modulo the GUID in the assembly and the GUID embedded in some
field initializers that use the assembly GUID for their name, the
assemblies are idential before and after the patch.
On my (cursed?) MacBook Pro, calling
System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()
results in an exception:
System.ArgumentException: length
at System.Array.Copy (System.Array sourceArray, Int32 sourceIndex, System.Array destinationArray, Int32 destinationIndex, Int32 length) [0x00000] in <filename unknown>:0
at System.Net.NetworkInformation.MacOsNetworkInterface.ImplGetAllNetworkInterfaces () [0x00000] in <filename unknown>:0
at System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces () [0x00000] in <filename unknown>:0
Some printfs later, and we see why:
Array.Copy(array.Length=12, 3, array.Length=0, 0, 0)
Array.Copy(array.Length=12, 4, array.Length=0, 0, 0)
Array.Copy(array.Length=12, 4, array.Length=0, 0, 0)
Array.Copy(array.Length=12, 3, array.Length=6, 0, 6)
Array.Copy(array.Length=12, 3, array.Length=6, 0, 6)
Array.Copy(array.Length=12, 3, array.Length=8, 0, 4)
Array.Copy(array.Length=12, 4, array.Length=6, 0, 6)
Array.Copy(array.Length=12, 8, array.Length=6, 0, 6)
# BOOM!
(Apparently I have 8 interfaces: lo0, gif0, stf0, en0, en1, fw0, p2p0,
and vboxnet0.)
The problem is readily obvious: we're trying to read 6 bytes of data
when only 4 are available, and Array.Copy() complains appropriately.
The fix -- which looks to almost contradict a02076ba -- is to use
`sockaddrdl.sdl_data.Length - sockaddrdl.sdl_nlen` instead of
`sockaddrdl.sdl_data.Length - macAddress.Length` (or sdl_alen).
sdl_nlen is the offset into the source sockaddrdl.sdl_data array, and
in this case sockaddrdl.sdl_alen (the length of the destination
macAddress) isn't the same as sockaddrdl.sdl_nlen, hence the breakage.
* Ping.cs: generates a random ICMP Identifier field per Echo to help
match up pings and their responses. Now has valid TTL and timeouts apply to
the correct pings. Also fixed bugs were received Sequence and
Identifier would be corrupt for values >255, and fixed corruption of
the Data field.
Patch by Michael Walsh that fixes bug #627330.
* Ping.cs: Try to detect the path to the bin command, since different
Unix systems store it in different places.
Fixes#519272.
svn path=/trunk/mcs/; revision=147831
* GatewayIPAddressInformationCollection.cs:
* IPInterfaceProperties.cs: implement GatewayAddresses for linux.
Original patch by Christoph von Wittich.
Fixes bug #544640.
svn path=/trunk/mcs/; revision=143525
* LinuxNetworkInterfaceMarshal.cs: Add StructLayout attribute to structures, so
the aot compiler can generate PtrToStructure wrappers for them.
svn path=/trunk/mcs/; revision=142578
* Ping.cs: we just need the address(es), not a host entry. This avoids
querying the DNS server(s) when the target is an IP address.
svn path=/trunk/mcs/; revision=133459
* Ping.cs: close the socket in SendPrivileged. Use Buffer.BlockCopy
instead of Array.Copy. Return IPStatus.Unknown instead of throwing an
exception for unknown status codes received.
svn path=/trunk/mcs/; revision=121278
* IPAddressCollection.cs: added an internal method to make the
collection read-only.
* IPInterfaceProperties.cs: read DNS client configuration from
/etc/resolv.conf.
* NetworkInterface.cs: dummy Speed property for linux.
Bug #450211 fixed.
svn path=/trunk/mcs/; revision=120281
* Ping.cs: the time for the arguments of 'ping' is in seconds. Don't
read the output of running the command, since we trust the return
code.
svn path=/trunk/mcs/; revision=119534