Hi,

I made a patch in connman that might be useful for others.
I noticed that connman has an option  FallbackNameservers which is currently 
only used in tethering mode.

I made a patch that also uses this the nameservers given with the 
FallbackNameservers in case any other nameserver (returned by the DHCP server) 
fails. This can be very useful in network where DNS requests to external 
addresses are not forwarded.

Patch is made on connman 1.9 but is still valid on latest connman version.

I'll let community decide whether this is suitable for mainstream connman code 
or just custom patch.

Mario Vitale
Disclaimer

This e-mail and its attachments is intended only for the person(s) or entity to 
which it is addressed. If you receive this e-mail by mistake, please delete 
this e-mail from your system and destroy all copies of it. It may contain 
confidential and/or privileged information. You should not copy it or use it 
for any purpose nor disclose its contents to any person unless allowed by a 
written document between the sender and the addressee.
--- connman-1.9-orig/src/timeserver.c	2012-07-24 22:45:51.000000000 +0200
+++ connman-1.9/src/timeserver.c	2013-02-14 13:27:33.130217254 +0100
@@ -272,6 +272,7 @@
 {
 	char **nameservers;
 	int i;
+	char **fallback_nameservers;
 
 	DBG("service %p", service);
 
@@ -305,6 +306,13 @@
 	for (i = 0; nameservers[i] != NULL; i++)
 		g_resolv_add_nameserver(resolv, nameservers[i], 53, 0);
 
+	//add fallback nameservers
+	fallback_nameservers = connman_setting_get_string_list("FallbackNameservers");
+	if (fallback_nameservers ) {
+		for (i = 0; fallback_nameservers != NULL && fallback_nameservers[i] != NULL; i++) 
+			g_resolv_add_nameserver(resolv, fallback_nameservers[i], 53, 0);
+	}	
+
 	g_strfreev(nameservers);
 
 	return __connman_timeserver_sync(service);
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to