Check if DNS is valid
authorGuillaume Zajac <guillaume.zajac@linux.intel.com>
Mon, 18 Mar 2013 09:10:16 +0000 (10:10 +0100)
committerwootak.jung <wootak.jung@samsung.com>
Sun, 24 Mar 2013 07:46:41 +0000 (16:46 +0900)
Change-Id: I190b67c6f049c4af82dbfbd8f1c2b188fc8481f4

src/s_ps.c

index 5d0eae9..d9b85cd 100644 (file)
@@ -266,6 +266,19 @@ static void on_response_get_dns_cmnd(TcorePending *p, int data_len, const void *
                                dbg("Secondary DNS :- %s", dns_sec);
                        }
 
+                       if ((g_strcmp0("0.0.0.0", dns_prim) == 0)
+                                       && (g_strcmp0("0.0.0.0", dns_sec) == 0)) {
+                               dbg("Invalid DNS");
+
+                               _ps_free(dns_prim);
+                               _ps_free(dns_sec);
+
+                               tcore_at_tok_free(tokens);
+                               tokens = NULL;
+
+                               goto exit_fail;
+                       }
+
                        tcore_context_set_ipv4_dns(ps_context, dns_prim, dns_sec);
                        _ps_free(dns_prim);
                        _ps_free(dns_sec);