2008-09-28 Gonzalo Paniagua Javier <gonzalo.mono@gmail.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Sun, 28 Sep 2008 23:20:11 +0000 (23:20 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Sun, 28 Sep 2008 23:20:11 +0000 (23:20 -0000)
* NetworkInterface.cs: special case for loopback interfaces so that
their a physical interface address is PhysicalInterfaceAddress.None.
Fixes bug #422118.

svn path=/trunk/mcs/; revision=114343

mcs/class/System/System.Net.NetworkInformation/ChangeLog
mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs

index fec8ef948f6a93d1d32464eaabe263bb4666eb0e..d8a7edbfd39f5b3bc7369600f04fc19addcfe466 100644 (file)
@@ -1,3 +1,9 @@
+2008-09-28 Gonzalo Paniagua Javier <gonzalo.mono@gmail.com>
+
+       * NetworkInterface.cs: special case for loopback interfaces so that
+       their a physical interface address is PhysicalInterfaceAddress.None.
+       Fixes bug #422118.
+
 2008-08-15  Atsushi Enomoto  <atsushi@ximian.com>
 
        * IPInterfaceProperties.cs, UnicastIPAddressInformation.cs,
index 5b19630a428659d053a35a450f04ffb0e69d366d..43014a3a1eaf8946566e25c579628a435818231f 100644 (file)
@@ -215,6 +215,7 @@ namespace System.Net.NetworkInformation {
                                                                        
                                                                        case LinuxArpHardware.LOOPBACK:
                                                                                type = NetworkInterfaceType.Loopback;
+                                                                               macAddress = null;
                                                                                break;
 
                                                                        case LinuxArpHardware.FDDI:
@@ -242,7 +243,7 @@ namespace System.Net.NetworkInformation {
                                        if (!address.Equals (IPAddress.None))
                                                iface.AddAddress (address);
 
-                                       if (macAddress != null)
+                                       if (macAddress != null || type == NetworkInterfaceType.Loopback)
                                                iface.SetLinkLayerInfo (index, macAddress, type);
 
                                        next = addr.ifa_next;