Regarding connman service_connect
Hi All, I am trying to understand the call flow sequence when we try to do a connection using connman connect service. I see the below logs. connmand[2769]: src/network.c:connman_network_get_bool() network 0x2cbde138 key WiFi.UseWPS connmand[2769]: src/network.c:connman_network_get_string() network 0x2cbde138 key WiFi.PinWPS connmand[2769]: src/network.c:connman_network_ref_debug() 0x2cbde138 name sistlajr ref 4 by plugins/wifi.c:1493:network_connect() connmand[2769]: src/network.c:connman_network_set_associating() network 0x2cbde138 associating 1 connmand[2769]: src/service.c:__connman_service_ipconfig_indicate_state() service 0x2cbe08f0 (wifi_00025b03f749_736973746c616a72_managed_psk) state 2 (association) type 1 (IPv4) connmand[2769]: src/service.c:service_indicate_state() service 0x2[ 192.082736] systemd[1]: bluetooth.service operation timed out. Terminating. cbe08f0 old idle - new association/idle = association connmand[2769]: src/session.c:service_state_changed() service 0x2cbe08f0 state 2 connmand[2769]: src/notifier.c:notify_idle_state() idle 0 connmand[2769]: src/manager.c:idle_state() idle 0 connmand[2769]: src/connection.c:update_order() connmand[2769]: src/connection.c:__connman_connection_update_gateway() default (nil) connmand[2769]: src/service.c:__connman_service_ipconfig_indicate_state() service 0x2cbe08f0 (wifi_00025b03f749_73692_managed_psk) state 2 (association) type 2 (IPv6) connmand[2769]: src/service.c:service_indicate_state() service 0x2cbe08f0 old association - new association/association = association connmand[2769]: src/service.c:connman_service_unref_debug() 0x2cbe08f0 ref 1 by src/service.c:7679:agent_context_unref() connmand[2769]: plugins/wifi.c:connect_callback() network 0x2cbde138 result 0 connmand[2769]: src/network.c:connman_network_unref_debug() 0x2cbde138 name sidfsdfsr ref 3 by plugins/wifi.c:1393:connect_callback() connmand[2769]: src/service.c:service_send_changed() connmand[2769]: src/service.c:service_append_added_foreach() changed /net/connman/service/wifi_00025b03f749_736973746c616a72_managed_psk My question here is I see a call to agent API agent_context_unref(). But i am not sure who is issuing this. Can some one please let me know how this agent API is getting called. Regards, Sistla. ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH] Add setting: UpdateResolvConf
On Wed, 2015-02-04 at 16:20 +0100, Martin Tournoij wrote: It's not magic :-) But it queries the root server, then .com from that, and then example.com from that, insofar as I understand DNS. Or maybe I misunderstood something? I have no lines with forward-zone in /etc/unbound/unbound.conf I followed this guide btw: https://wiki.archlinux.org/index.php/Unbound (but *not* section 2.6 Forwarding queries). For a standard laptop setup, I advise against using the root servers directly. First of all it causes unwanted load if everybody forwards their queries all the way to the root. And sometimes it is not possible to make direct outbound queries from the networks connected to, every now and then one ends up in a network that drops DNS queries that do not go to the domain's designated DNS servers. Google's public DNS servers would suit you better in this case even though direct queries to those may be dropped by some of the networks. In addition, nameservers are known to provide more and better IP addressing when on the inside of the connected network. With the above in mind, ConnMan has the main.conf option FallbackNameservers, where one can specify backup nameservers should there be absolutely zero name server information otherwise. The only safe choice here is to add Google's servers, as they are reachable from a majority of networks. So for about 99% of ConnMan users, using the DNS servers provided via DHCP is the correct action to take in all connected networks. HTH, Patrik ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH] Add setting: UpdateResolvConf
On Wed, 2015-02-04 at 17:11 +0200, Tomasz Bursztyka wrote: No, afaik you need to disable dnsproxy. Or then you will end up with: dnsproxy configured to use 127.0.0.53 as nameserver, and resolv.conf with 127.0.0.1 as nameserver. Duplicated local dns cache/forwarder. If dnsproxy is disable, resolv.conf will directly get the 127.0.0.53 To do this with the least amount of hassle with ConnMan while having adsuck listening on 127.0.0.53 and forwarding queries to unbound on 127.0.0.54 - which I strongly suggest should forward all queries to Google's name servers https://developers.google.com/speed/public-dns/ - do this for each service: 'connmanctl config XX nameservers 127.0.0.53', where X is the service id printed by connmanctl. Add --nodnsproxy to the systemd service file or init.d/ script as an argument to the connman executable. This prevents the device from doing double DNS caching by disabling ConnMan's caching. Add 127.0.0.53 in the FallbackNameservers directive in main.conf as this is the entry used when doing tethering with the --nodnsproxy option set or if _no_ nameserver info has been provided via DHCP for some utterly misconfigured server side reason or static IP address. Doing it this way is admittedly a bit more work but has the benefit of being a configuration supported by upstream :-). Cheers, Patrik ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH] Add setting: UpdateResolvConf
Hi, Is there any response on this? I don't want to badger anyone, but I'm subscribed to the connman mail list just for this issue. It would like to give my INBOX a break ;-) Thanks a lot! Martin ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: Issue found in service connman ordering
On Fri, 2015-01-30 at 09:14 +, Priyaranjan Singh wrote: But as I understood from you, priority ordering is decided by: There is a case zero, which in normal circumstances doesn't even try to autoconnect if there already is a connected service. This happens when PreferredTechnologies is unset. The case extends so that if PreferredTechnologies is set, and the connected service is already of the most preferred type, autoconnect is not run either. In both these cases there is only one service connected, and it may be connected in the 'ready' state. i) online service over ready service ii) In case of same connection status(online or ready), then PreferredTechnologies ordering will be considered. After there is a PreferredTechnology more preferred than the one connected, the above conditions are considered. HTH, Patrik ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH] Add setting: UpdateResolvConf
On Tue, 2015-01-06 at 05:01 +0100, Martin Tournoij wrote: This is useful because my laptop runs it's own resolver. Every time I connect, Connman overwrites /etc/resolv.conf, and I need to script around this by overwriting it again after this... How do you pick up the DNS servers when changing networks if ConnMan never writes the ones obtained via DHCP anywhere? How do you update the DNS servers at the moment when using your own resolver? Cheers, Patrik ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH] Add setting: UpdateResolvConf
On Wed, Feb 4, 2015, at 14:59, Patrik Flykt wrote: On Tue, 2015-01-06 at 05:01 +0100, Martin Tournoij wrote: This is useful because my laptop runs it's own resolver. Every time I connect, Connman overwrites /etc/resolv.conf, and I need to script around this by overwriting it again after this... How do you pick up the DNS servers when changing networks if ConnMan never writes the ones obtained via DHCP anywhere? How do you update the DNS servers at the moment when using your own resolver? I don't. I run unbound ( adsuck) on my laptop, so it works everywhere. ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH] Add setting: UpdateResolvConf
Hi, It makes sense to me to not use every random DNS server out there... Sure, but your ubound does not magically resolve names by itself: it does forward the DNS queries to whatever has been configured (check /etc/unbound/unbound.conf keyword forward-zone) and cache the results relevantly. DNSSEC should ensure I get responses that haven't been tampered with... Sure, as long as the configured DNS you use to forward to support it. Tomasz ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH] Add setting: UpdateResolvConf
On ke, 2015-02-04 at 15:53 +0100, Martin Tournoij wrote: On Wed, Feb 4, 2015, at 15:41, Jukka Rissanen wrote: Just wondering where do you get the nameserver IP addresses in this case? Are you manually updating resolv.conf? Not sure if I understand this question? I mean where does unbound gets its names resolved, are you using 8.8.8.8 or similar global service? Let me explain my setup in more detail: - Run unbound on 127.0.0.54 - Run adsuck on 127.0.0.53, this filters ad domains (spoofs reply with 127.0.0.2), and forwards other queries to 127.0.0.42 (unbound). - Start connman with --nodnsproxy - For the root user, run a crontab with: */5 * * * * echo 'nameserver 127.0.0.53' /etc/resolv.conf unbound works as recursive resolver, no other DNS server required. This works, except for the first 0 to 5 minutes I connected to a new network. It's also more than a bit ugly... Is this a very esoteric setup? I don't know ... It makes sense to me to This is very exotic setup :) You might be able to configure connman to use your 127.0.0.53 server by configuring it to each service you are using (have not tested this thou). Example: connmanctl config your_service_id --nameservers 127.0.0.53 and then running connman with dnsproxy enabled. not use every random DNS server out there... DNSSEC should ensure I get responses that haven't been tampered with... I don't know what random DNS servers do at starbucks do... Thanks, Martin Cheers, Jukka ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH] Add setting: UpdateResolvConf
Hi, You might be able to configure connman to use your 127.0.0.53 server by configuring it to each service you are using (have not tested this thou). Example: connmanctl config your_service_id --nameservers 127.0.0.53 and then running connman with dnsproxy enabled. No, afaik you need to disable dnsproxy. Or then you will end up with: dnsproxy configured to use 127.0.0.53 as nameserver, and resolv.conf with 127.0.0.1 as nameserver. Duplicated local dns cache/forwarder. If dnsproxy is disable, resolv.conf will directly get the 127.0.0.53 Tomasz ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH] Add setting: UpdateResolvConf
Hi, On Wed, 2015-02-04 at 15:23 +0100, Martin Tournoij wrote: How do you pick up the DNS servers when changing networks if ConnMan never writes the ones obtained via DHCP anywhere? How do you update the DNS servers at the moment when using your own resolver? I don't. I run unbound ( adsuck) on my laptop, so it works everywhere. So if you do a lookup for 'slashdot.org', how is unbound configured to properly resolve that name from any network you visit? Google? Cheers, Patrik ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH] Add setting: UpdateResolvConf
Hi Martin, On ke, 2015-02-04 at 15:34 +0100, Martin Tournoij wrote: On Wed, Feb 4, 2015, at 15:28, Patrik Flykt wrote: Hi, On Wed, 2015-02-04 at 15:23 +0100, Martin Tournoij wrote: How do you pick up the DNS servers when changing networks if ConnMan never writes the ones obtained via DHCP anywhere? How do you update the DNS servers at the moment when using your own resolver? I don't. I run unbound ( adsuck) on my laptop, so it works everywhere. So if you do a lookup for 'slashdot.org', how is unbound configured to properly resolve that name from any network you visit? Google? It just works as a recursive resolver, I don't need to rely on any external DNS resolvers (which is how unbound works by default). Just wondering where do you get the nameserver IP addresses in this case? Are you manually updating resolv.conf? Cheers, Jukka ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH] Add setting: UpdateResolvConf
On Wed, Feb 4, 2015, at 15:41, Jukka Rissanen wrote: Just wondering where do you get the nameserver IP addresses in this case? Are you manually updating resolv.conf? Not sure if I understand this question? Let me explain my setup in more detail: - Run unbound on 127.0.0.54 - Run adsuck on 127.0.0.53, this filters ad domains (spoofs reply with 127.0.0.2), and forwards other queries to 127.0.0.42 (unbound). - Start connman with --nodnsproxy - For the root user, run a crontab with: */5 * * * * echo 'nameserver 127.0.0.53' /etc/resolv.conf unbound works as recursive resolver, no other DNS server required. This works, except for the first 0 to 5 minutes I connected to a new network. It's also more than a bit ugly... Is this a very esoteric setup? I don't know ... It makes sense to me to not use every random DNS server out there... DNSSEC should ensure I get responses that haven't been tampered with... I don't know what random DNS servers do at starbucks do... Thanks, Martin ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
MoveBefore/MoveAfter not working as expected
Hello All, Call to MoveBefore/MoveAfter is not changing the default gateway where service moved to top is in ready state. Point I want to highlight is the outcome of moveBefore/moveAfter (outcome of step 5): 1. Wifi is not becoming default gateway 2. Drop in connection status from 'online' to 'ready' for ethernet Note: Updated preferred technology list PreferredTechnologies = wifi,ethernet,Bluetooth Please let me know if this is expected output? Here is the test: 1.connected wifi datausage off(ready mode) root@imx6x-std:~# connmanctl services List of all services: *AR XT1033 8153 { wifi_001cc1a25dff_585431302038313533_managed_none } 2.USB connected with datausage off(ready mode) root@imx6x-std:~# connmanctl services List of all services: *AR Wired{ ethernet_aabbccddeeff_cable } *AR XT1033 8153{ wifi_001cc1a25dff_585431302038313533_managed_none } 3.call MoveBefore to take wifi to top dbus-send --system --type=method_call --print-reply --dest=net.connman /net/connman/service/wifi_001cc1a25dff_585431302038313533_managed_none net.connman.Service.MoveBefore objpath:/net/connman/service/ethernet_aabbccddeeff_cable root@imx6x-std:~# connmanctl services List of all services: *AR Wired{ ethernet_aabbccddeeff_cable } *AR XT1033 8153{ wifi_001cc1a25dff_585431302038313533_managed_none } 4.disconnect USB and connect it again (data usage on) root@imx6x-std:~# connmanctl services List of all services: *AO Wired{ ethernet_aabbccddeeff_cable } *AR XT1033 8153{ wifi_001cc1a25dff_585431302038313533_managed_none } 5.call MoveAfter to take wifi to top dbus-send --system --type=method_call --print-reply --dest=net.connman /net/connman/service/ethernet_aabbccddeeff_cable net.connman.Service.MoveAfter objpath:/net/connman/service/wifi_001cc1a25dff_585431302038313533_managed_none root@imx6x-std:~# connmanctl services List of all services: *AR Wired{ ethernet_aabbccddeeff_cable } *AR XT1033 8153{ wifi_001cc1a25dff_585431302038313533_managed_none } Best Regards, PriyaranjanS This message contains information that may be privileged or confidential and is the property of the KPIT Technologies Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Technologies Ltd. does not accept any liability for virus infected mails. ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH] Add setting: UpdateResolvConf
On Wed, Feb 4, 2015, at 16:06, Tomasz Bursztyka wrote: Hi, It makes sense to me to not use every random DNS server out there... Sure, but your ubound does not magically resolve names by itself: it does forward the DNS queries to whatever has been configured (check /etc/unbound/unbound.conf keyword forward-zone) and cache the results relevantly. It's not magic :-) But it queries the root server, then .com from that, and then example.com from that, insofar as I understand DNS. Or maybe I misunderstood something? I have no lines with forward-zone in /etc/unbound/unbound.conf I followed this guide btw: https://wiki.archlinux.org/index.php/Unbound (but *not* section 2.6 Forwarding queries). ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH] Add setting: UpdateResolvConf
On Wed, Feb 4, 2015, at 16:06, Jukka Rissanen wrote: You might be able to configure connman to use your 127.0.0.53 server by configuring it to each service you are using (have not tested this thou). Example: connmanctl config your_service_id --nameservers 127.0.0.53 and then running connman with dnsproxy enabled. Thanks Yeah, I saw some settings for this today, but then I need to do this for every network I connect with, not to mention setting might get lost on upgrades/reinstalls since they're not in /etc... Simply leaving /etc/resolv.conf alone seems like the simplest/most foolproof way to me. It gives the user control to do exotic (which my setup apparently is) and/or smart things; this fits well with my UNIX philosophy :-) But I don't know if it also fits with connman's philosophy ;-) Another way might be to add some way to (globally) control nameserver settings from connman, but that's more complicated... Or connman could be left as-is, and my esoteric setup would be considered unsupported (I would not prefer this, obviously :-) ). Cheers ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman