]> git.saurik.com Git - apple/configd.git/commitdiff
configd-24.1.tar.gz mac-os-x-1002 mac-os-x-1003 mac-os-x-1004 v24.1
authorApple <opensource@apple.com>
Fri, 20 Apr 2001 21:49:37 +0000 (21:49 +0000)
committerApple <opensource@apple.com>
Fri, 20 Apr 2001 21:49:37 +0000 (21:49 +0000)
SystemConfiguration.fproj/CustomInfo.plist
SystemConfiguration.fproj/SCNetwork.c

index 89cf132d70284bec4d05fd453852416e7e69e605..9fe5a3dc19df4a7cb0d343d6103485bc4058f32f 100644 (file)
@@ -1,5 +1,5 @@
 {
        CFBundleName = "SystemConfiguration";
        CFBundleIdentifier = "com.apple.SystemConfiguration";
-       CFBundleShortVersionString = "1.0.0";
+       CFBundleShortVersionString = "1.0.1";
 }
index 9c24f2e7e5222f97edc7e9f19f19d529548e6779..18289842808c8bab021c57362232a92d55953fbd 100644 (file)
@@ -1133,6 +1133,7 @@ SCNIsReachableByName(const char           *nodename,
                     const char         **errorMessage)
 {
        struct in_addr  *defaultRoute   = NULL;
+       struct hostent  *h;
        int             i;
        CFDictionaryRef interfaces      = NULL;
        CFArrayRef      interfaceOrder  = NULL;
@@ -1225,6 +1226,58 @@ SCNIsReachableByName(const char          *nodename,
                }
        }
 
+       if (res) {
+               goto done;
+       }
+
+       /*
+        * The getaddrinfo() function call didn't return any addresses.  While
+        * this may be the correct answer we have found that some DNS servers
+        * may, depending on what has been cached, not return all available
+        * records when issued a T_ANY query.  To accomodate these servers
+        * we double check by using the gethostbyname() function which uses
+        * a simple T_A query.
+        */
+
+#ifdef DEBUG
+       if (SCDOptionGet(session, kSCDOptionDebug))
+               SCDLog(LOG_INFO, CFSTR("getaddrinfo() returned no addresses, try gethostbyname()"));
+#endif /* DEBUG */
+
+       h = gethostbyname(nodename);
+       if (h && h->h_length) {
+               struct in_addr **s      = (struct in_addr **)h->h_addr_list;
+
+               while (*s) {   
+                       struct sockaddr_in      sa;
+
+                       bzero(&sa, sizeof(sa));
+                       sa.sin_len    = sizeof(sa);
+                       sa.sin_family = AF_INET;
+                       sa.sin_addr   = **s;
+
+                       ns_status = checkAddress(session,
+                                                (struct sockaddr *)&sa,
+                                                sizeof(sa),
+                                                services,
+                                                interfaces,
+                                                interfaceOrder,
+                                                defaultRoute,
+                                                flags,
+                                                errorMessage);
+                       if (ns_status > scn_status) {
+                               /* return the best case result */
+                               scn_status = ns_status;
+                               if (ns_status == SCN_REACHABLE_YES) {
+                                       /* we're in luck */
+                                       break;
+                               }
+                       }
+
+                       s++;
+               }
+       }
+
     done :
 
        _IsReachableFree(services, interfaces, interfaceOrder, defaultRoute);