diff -rup ptlib-2.6.5-orig/src/ptlib/unix/socket.cxx ptlib-2.6.5/src/ptlib/unix/socket.cxx
--- ptlib-2.6.5-orig/src/ptlib/unix/socket.cxx	2009-09-21 04:25:17.000000000 +0400
+++ ptlib-2.6.5/src/ptlib/unix/socket.cxx	2010-03-04 19:34:07.000000000 +0300
@@ -1557,11 +1556,9 @@ PBoolean PIPSocket::GetInterfaceTable(In
 {
 #if P_HAS_IPV6
   // build a table of IPV6 interface addresses
-  typedef std::map<PString, PString> IP6ListType;
-  IP6ListType ip6Ifaces;
   {
     FILE * file;
-    int dummy;
+    int dummy, scope;
     int addr[16];
     char ifaceName[255];
     if ((file = fopen("/proc/net/if_inet6", "r")) != NULL) {
@@ -1570,17 +1567,30 @@ PBoolean PIPSocket::GetInterfaceTable(In
               &addr[4],  &addr[5],  &addr[6],  &addr[7], 
               &addr[8],  &addr[9],  &addr[10], &addr[11], 
               &addr[12], &addr[13], &addr[14], &addr[15], 
-             &dummy, &dummy, &dummy, &dummy, ifaceName) != EOF) {
+             &dummy, &dummy, &scope, &dummy, ifaceName) != EOF) {
+        PString name(ifaceName);
         PString addrStr(
-          psprintf("%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
+          psprintf("%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
               addr[0],  addr[1],  addr[2],  addr[3], 
               addr[4],  addr[5],  addr[6],  addr[7], 
               addr[8],  addr[9],  addr[10], addr[11], 
               addr[12], addr[13], addr[14], addr[15]
           )
         );
-        PString iface(ifaceName);
-        ip6Ifaces.insert(IP6ListType::value_type(ifaceName, addrStr));
+	if (scope == 0) { // Consider only addresses with global scope
+          PString iface(ifaceName);
+          PIPSocket::Address addr(addrStr);
+          int i;
+          for (i = 0; i < list.GetSize(); i++) {
+            if (list[i].GetName() == name &&
+                list[i].GetAddress() == addr)
+              break;
+          }
+          if (i >= list.GetSize()) {
+            list.Append(PNEW InterfaceEntry(name, addr,
+              PIPSocket::Address::GetAny(6), "", ""));
+          }
+        }
       }
       fclose(file);
     }
@@ -1676,16 +1686,10 @@ PBoolean PIPSocket::GetInterfaceTable(In
 #endif
                   break;
               }
-#if P_HAS_IPV6
-              PString ip6Addr;
-              IP6ListType::const_iterator r = ip6Ifaces.find(name);
-              if (r != ip6Ifaces.end())
-                ip6Addr = r->second;
-#endif
               if (i >= list.GetSize())
                 list.Append(PNEW InterfaceEntry(name, addr, mask, macAddr
 #if P_HAS_IPV6
-                , ip6Addr
+                , ""
 #endif
                 ));
             }
