2008-11-25 Atsushi Enomoto <atsushi@ximian.com>
authorMiguel de Icaza <miguel@gnome.org>
Sat, 29 Nov 2008 20:25:30 +0000 (20:25 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Sat, 29 Nov 2008 20:25:30 +0000 (20:25 -0000)
* Makefile : update old nunit options that break upgrade to 2.4.

2008-11-03 Gonzalo Paniagua Javier <gonzalo@novell.com>

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

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

index 0e84c513dc1981ffa8f6e22ee6c6b7ee7b12e377..b604b1799343d6b0fb4780d13facad20aecc03c9 100644 (file)
@@ -1,3 +1,9 @@
+2008-11-29  Miguel De Icaza  <miguel@novell.com>
+
+       * NetworkInterface.cs: Do not throw an exception when scanning
+       external kernel information that might cause problems.   The
+       application should not crash just trying to fetch interfaces from
+       the system. 
 
 2008-11-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
 
index 4eb8dda6844a238acf3eeacdb5cc3df812926279..4b3b527f24c81dc6d6efb907db584a25df3a120e 100644 (file)
@@ -180,8 +180,11 @@ namespace System.Net.NetworkInformation {
                                                        address = new IPAddress (sockaddr.sin_addr);
                                                } else if (sockaddr.sin_family == AF_PACKET) {
                                                        sockaddr_ll sockaddrll = (sockaddr_ll) Marshal.PtrToStructure (addr.ifa_addr, typeof (sockaddr_ll));
-                                                       if (((int)sockaddrll.sll_halen) > sockaddrll.sll_addr.Length)
-                                                               throw new SystemException("Bad hardware address length");
+                                                       if (((int)sockaddrll.sll_halen) > sockaddrll.sll_addr.Length){
+                                                               Console.Error.WriteLine ("Got a bad hardware address length for an AF_PACKET {0} {1}",
+                                                                                        sockaddrll.sll_halen, sockaddrll.sll_addr.Length);
+                                                               continue;
+                                                       }
                                                        
                                                        macAddress = new byte [(int) sockaddrll.sll_halen];
                                                        Array.Copy (sockaddrll.sll_addr, 0, macAddress, 0, macAddress.Length);