[Title] Add DNS support for host has local DNS cache/DNS server
authorsyeon.hwang <syeon.hwang@samsung.com>
Thu, 12 Jul 2012 11:28:09 +0000 (20:28 +0900)
committersyeon.hwang <syeon.hwang@samsung.com>
Thu, 12 Jul 2012 11:28:09 +0000 (20:28 +0900)
[Type]
[Module]
[Priority]
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

tizen/src/option.c

index 44f6591..547cde9 100644 (file)
@@ -129,6 +129,15 @@ int gethostDNS(char *dns1, char *dns2)
        }
        free(pAdapterAddr);
 #endif
+
+       // by caramis... change DNS address if localhost has DNS server or DNS cache.
+       if(!strncmp(dns1, "127.0.0.1", 9) || !strncmp(dns1, "localhost", 9)) {
+               strncpy(dns1, "10.0.2.2", 9);
+       }
+       if(!strncmp(dns2, "127.0.0.1", 9) || !strncmp(dns2, "localhost", 9)) {
+               strncpy(dns2, "10.0.2.2", 9);
+       }
+
        return 0;
 }