2009-01-19 Gonzalo Paniagua Javier <gonzalo@novell.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Mon, 19 Jan 2009 22:26:39 +0000 (22:26 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Mon, 19 Jan 2009 22:26:39 +0000 (22:26 -0000)
* Socket.cs: don't throw when there's no ipv6 configuration.

svn path=/branches/mono-2-2/mcs/; revision=123833

mcs/class/System/System.Net.Sockets/ChangeLog
mcs/class/System/System.Net.Sockets/Socket.cs

index 7da38aeb32ddc1ce3e8e0829874a2972dfa6e1b7..cc94907e378a84a5298f2fd5c8ef6ea5d4d2a96a 100644 (file)
@@ -1,4 +1,8 @@
 
+2009-01-19 Gonzalo Paniagua Javier <gonzalo@novell.com>
+
+       * Socket.cs: don't throw when there's no ipv6 configuration.
+
 2008-12-03 Gonzalo Paniagua Javier <gonzalo@novell.com>
 
        * UdpClient.cs: don't Poll() in Receive(), the call to ReceiveFrom
index b273d718e086943190cbdbc41245e7d10c3703e4..6a45b47735188c3c65d994a198ddd0b0d59bc439 100644 (file)
@@ -1328,7 +1328,7 @@ namespace System.Net.Sockets
                                if (config != null)
                                        ipv6Supported = config.Ipv6.Enabled ? -1 : 0;
 #else
-                               NetConfig config = (NetConfig)System.Configuration.ConfigurationSettings.GetConfig("system.net/settings");
+                               NetConfig config = System.Configuration.ConfigurationSettings.GetConfig("system.net/settings") as NetConfig;
                                if (config != null)
                                        ipv6Supported = config.ipv6Enabled ? -1 : 0;
 #endif
@@ -1339,7 +1339,9 @@ namespace System.Net.Sockets
                                                tmp.Close();
 
                                                ipv6Supported = 1;
-                                       } catch { }
+                                       } catch {
+                                               ipv6Supported = 0;
+                                       }
                                }
                        }
                }