Hi,
I have a problem with connman. I have a board with static IP set and fallback name servers
defined in the /etc/connman/main.conf file (8.8.8.8,8.8.4.4 in my case). With connmanctl I
see that the specified nameservers are in use:
connmanctl> services ethernet_...
...
Nameservers = [ 8.8.8.8, 8.8.4.4 ]
However trying to ping e.g.
google.com fails. When I change the nameservers with
connmanctl even with the same name server IP addresses, then the resolution works.
As log says, connman is trying to add fallback name servers, what initially fails:
daemon.debug connmand[710]: resolver.c:__connman_resolver_init() server 8.8.8.8
daemon.debug connmand[710]: resolver.c:append_resolver() index -1 domain (null) server
8.8.8.8 lifetime 0 flags 1 daemon.debug connmand[710]:
dnsproxy.c:__connman_dnsproxy_append() index -1 server 8.8.8.8 daemon.debug connmand[710]:
dnsproxy.c:find_server() index -1 server 8.8.8.8 proto 17 daemon.debug connmand[710]:
dnsproxy.c:create_server() index -1 server 8.8.8.8 daemon.debug connmand[710]:
dnsproxy.c:server_create_socket() index -1 server 8.8.8.8 proto 17 daemon.debug
connmand[710]: dnsproxy.c:server_create_socket() sk 16 daemon.err connmand[710]: Failed to
connect to server 8.8.8.8
It fails in connect() with errno 101 (network is unreachable). This is ok, because before
entering the main loop network is unreachable. Later the log says:
daemon.debug connmand[710]: service.c:append_dns() append fallback nameservers
daemon.debug connmand[710]: service.c:append_nameservers() servers[0] 8.8.8.8 available 1
daemon.debug connmand[710]: service.c:append_nameservers() servers[1] 8.8.4.4 available 1
Now the nameservers should be ready to use. Trying to ping
google.com, ping fails with bad
address error, and the log says:
daemon.debug connmand[710]: dnsproxy.c:udp_listener_event() Received 28 bytes (id 0x3034)
daemon.debug connmand[710]: dnsproxy.c:parse_request() id 0x3034 qr 0 opcode 0 qdcount 1
arcount 0 daemon.debug connmand[710]: dnsproxy.c:parse_request() query
google.com.
daemon.debug connmand[710]: dnsproxy.c:send_response() sk 12 daemon.debug connmand[710]:
dnsproxy.c:send_response() id 0x3034 qr 0 opcode 0
This is because server_list in udp_listener_event() is empty. Ok, let's go further.
With connmanctl I set the same nameserver IPs, log proves that they are in use:
daemon.debug connmand[710]: service.c:set_property() service 0xdf390 daemon.debug
connmand[710]: inet.c:connman_inet_compare_subnet() host 8.8.8.8 daemon.debug
connmand[710]: inet.c:connman_inet_add_network_route() index 3 host 8.8.8.8 gateway
192.168.192.254 netmask (null) ...
In this case the name servers have positive index (fallback ones have -1). Now resolution
works perfectly well.
connmand[710]: dnsproxy.c:resolv() server 8.8.8.8 enabled 1 ...
However, resetting nameservers back to the empty value with connmanctl, connmand should
use ones from the config file. Now the name resolution stopped working because these
servers are disabled:
connmand[710]: dnsproxy.c:resolv() server 8.8.8.8 enabled 0
connmand[710]: dnsproxy.c:resolv() server 8.8.4.4 enabled 0
Temporarily I can fix this problem with setting nameservers explicitly with connmanctl,
but I think this is not the the intended way. Maybe I am doing something wrong. Any
help/suggestions will be appreciated, thanks.
Cheers,
Viliam