Re: Two different classes of the same technology? Seeking for any solution

2014-05-21 Thread Patrik Flykt

Hi,

On Tue, 2014-05-20 at 13:36 +0200, Jakub Ladman wrote:
> Is there a way to tell connman to use the gsm modem if and only if the
> wired network is unreachable?
> 
> At this time connman selects the one, which is first initialized after
> boot (i thing)

Set 'PreferredTechnologies = ethernet' in /etc/connman/main.conf to
prioritize ethernet over every other type of connection.

In this way ethernet will be chosen every time if the ethernet service
ends up in state 'online' or if every service - ethernet included - end
up in state 'ready'. The only time when ethernet is not chosen is when
the other service, i.e. cellular, is in state 'online' but ethernet
stops at state 'ready'.

Cheers,

Patrik

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: [PATCH] wifi: cancel autoscan timeout when removing device

2014-05-21 Thread Patrik Flykt
On Tue, 2014-05-20 at 11:21 +0300, Hannu Mallat wrote:
> Usually autoscan is cancelled when the device is disabled, but when
> wpa_supplicant leaves D-Bus while device has an ongoing power request,
> __connman_device_disable() will return early and thus autoscan timeout
> isn't cleared. The timeout callback may then access released memory
> when it's activated.
> 
> Add stop_autoscan() call to wifi_remove() to make sure there are no
> pending timeouts when the autoscan struct is released.

This one got applied, but the email saying so got lost.

Patrik

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: openvpn: client ip doesn't change

2014-05-21 Thread Patrik Flykt
On Wed, 2014-05-21 at 00:29 +0300, Yevhen Kyriukha wrote:
> It is a config for openvpn (/etc/openvpn). Openvpn is configured on
> ubuntu *without* connman. You can create simple server config and put
> "ifconfig-pool-persist ipp.txt" option to it. It will be enough for
> testing.

This file is not read when openvpn is started by connman-vpnd. See
doc/vpn-config-format.txt to see if there already is an option you can
use.

Cheers,

Patrik



___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: Connman crashes when loosing network

2014-05-21 Thread Tomasz Bursztyka

Hi Marcel,


Your patch works but that basically skips all multi line headers, so I think 
you have some coding to do;-)  If you want to support multi line headers of 
course.


Sure, the patch was just to verify the crash origin.
There is indeed a bit of work to get it right now.

Thanks for reporting this bug

Tomasz
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Please avoid ICMP Redirect when running VPN

2014-05-21 Thread Chengyi Zhao
Hi,

At first ,Please read the following information:
http://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#Redirect

If the VPN gateway is in the same subnet with the VPN client device(local
device),
please don't add the host route to the routing table of the client
device(local device).

Example:
VPN gateway IP: 192.168.1.105
Client device(local device) IP:   192.168.1.101
Router device IP: 192.168.1.1

Kernel IP routing table of Client device(local device):
Destination Gateway Genmask Flags   MSS Window  irtt
Iface
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0  0
vpn0
10.8.0.110.8.0.5255.255.255.255 UGH   0 0  0
vpn0
10.8.0.50.0.0.0 255.255.255.255 UH0 0  0
vpn0
192.168.1.0 0.0.0.0 255.255.255.0   U 0 0  0
eth0
192.168.1.1 0.0.0.0 255.255.255.255 UH0 0  0
eth0
*192.168.1.105   192.168.1.1 255.255.255.255 UGH   0 0  0
eth0*
202.103.24.68   192.168.1.1 255.255.255.255 UGH   0 0  0
eth0
202.103.44.150  192.168.1.1 255.255.255.255 UGH   0 0  0
eth0

Connman can't add the host route "192.168.1.105   192.168.1.1
255.255.255.255 UGH
0  0 0 eth0" to Kernel IP routing table in the client device,
otherwise, in some network environment, VPN client can't ping VPN gateway.

Thanks,

Chengyi
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: openvpn: client ip doesn't change

2014-05-21 Thread Jukka Rissanen
On ke, 2014-05-21 at 10:16 +0300, Patrik Flykt wrote:
> On Wed, 2014-05-21 at 00:29 +0300, Yevhen Kyriukha wrote:
> > It is a config for openvpn (/etc/openvpn). Openvpn is configured on
> > ubuntu *without* connman. You can create simple server config and put
> > "ifconfig-pool-persist ipp.txt" option to it. It will be enough for
> > testing.
> 
> This file is not read when openvpn is started by connman-vpnd. See
> doc/vpn-config-format.txt to see if there already is an option you can
> use.

There is a OpenVPN.ConfigFile option available that can pass an OpenVPN
configuration file via connman-vpnd to OpenVPN client process.
Unfortunately it is not currently documented in vpn-config-format.txt
file.


Cheers,
Jukka


___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: openvpn: client ip doesn't change

2014-05-21 Thread Yevhen Kyriukha
2014-05-21 15:43 GMT+03:00 Jukka Rissanen :
>
> On ke, 2014-05-21 at 10:16 +0300, Patrik Flykt wrote:
> > On Wed, 2014-05-21 at 00:29 +0300, Yevhen Kyriukha wrote:
> > > It is a config for openvpn (/etc/openvpn). Openvpn is configured on
> > > ubuntu *without* connman. You can create simple server config and put
> > > "ifconfig-pool-persist ipp.txt" option to it. It will be enough for
> > > testing.
> >
> > This file is not read when openvpn is started by connman-vpnd. See
> > doc/vpn-config-format.txt to see if there already is an option you can
> > use.
>
> There is a OpenVPN.ConfigFile option available that can pass an OpenVPN
> configuration file via connman-vpnd to OpenVPN client process.
> Unfortunately it is not currently documented in vpn-config-format.txt
> file.
>
>
> Cheers,
> Jukka
>
>

openvpn is started automatically by init script on my Ubuntu server.
It is started on separate machine (without connman). I placed config
file for my VPN server at /etc/openvpn, so openvpn will run it
automatically.



-- 
Best regards,
Yevhen
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: Two different classes of the same technology? Seeking for any solution

2014-05-21 Thread Jakub Ladman
Hi

> Set 'PreferredTechnologies = ethernet' in /etc/connman/main.conf to
> prioritize ethernet over every other type of connection.

Yes this is what i allready know.

But ... problem is, that the both interfaces appearing as cable ethernet.

Connman has no way to distinguish between the two.

I am seeking for some way to tell connman (using config file, udev or whatever) 
that one mac address is cable and second mac address is (much more expensive) 
connection of "class GSM".

The whole machine is semi-mobile. If it is home, it is connectet by fast and 
cheap ethernet, if it is somewhere outdoor, it is connected by GSM modem.

Is it described understandably?

It is the same situation as there were two ethernet cables, one much more 
slower as failsafe, one fast preferred.

How to tel connman that i preffer one of them?

Thank you

Jakub Ladman
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


[PATCH] service: helper function for sorting services

2014-05-21 Thread Hannu Mallat
Created a helper function to sort service list, to shorten the code
slightly and to ensure null pointer check is always done before using
the list pointer.
---
 src/service.c | 41 ++---
 1 file changed, 14 insertions(+), 27 deletions(-)

diff --git a/src/service.c b/src/service.c
index 6a70777..d586147 100644
--- a/src/service.c
+++ b/src/service.c
@@ -4729,6 +4729,14 @@ static gint service_compare(gconstpointer a, 
gconstpointer b)
return g_strcmp0(service_a->name, service_b->name);
 }
 
+static void service_list_sort(void)
+{
+   if (service_list && service_list->next) {
+   service_list = g_list_sort(service_list, service_compare);
+   service_schedule_changed();
+   }
+}
+
 /**
  * connman_service_get_type:
  * @service: service structure
@@ -4896,11 +4904,7 @@ int __connman_service_set_favorite_delayed(struct 
connman_service *service,
 
if (!delay_ordering) {
 
-   if (service_list->next) {
-   service_list = g_list_sort(service_list,
-   service_compare);
-   service_schedule_changed();
-   }
+   service_list_sort();
 
__connman_connection_update_gateway();
}
@@ -5449,10 +5453,7 @@ static int service_indicate_state(struct connman_service 
*service)
} else
set_error(service, CONNMAN_SERVICE_ERROR_UNKNOWN);
 
-   if (service_list->next) {
-   service_list = g_list_sort(service_list, service_compare);
-   service_schedule_changed();
-   }
+   service_list_sort();
 
__connman_connection_update_gateway();
 
@@ -6159,11 +6160,7 @@ int __connman_service_provision_changed(const char 
*ident)
if (services_dirty) {
services_dirty = false;
 
-   if (service_list->next) {
-   service_list = g_list_sort(service_list,
-   service_compare);
-   service_schedule_changed();
-   }
+   service_list_sort();
 
__connman_connection_update_gateway();
}
@@ -6237,10 +6234,7 @@ static int service_register(struct connman_service 
*service)
service_methods, service_signals,
NULL, service, NULL);
 
-   if (service_list->next) {
-   service_list = g_list_sort(service_list, service_compare);
-   service_schedule_changed();
-   }
+   service_list_sort();
 
__connman_connection_update_gateway();
 
@@ -6669,10 +6663,7 @@ static void update_from_network(struct connman_service 
*service,
if (!service->network)
service->network = connman_network_ref(network);
 
-   if (service_list->next) {
-   service_list = g_list_sort(service_list, service_compare);
-   service_schedule_changed();
-   }
+   service_list_sort();
 }
 
 /**
@@ -6834,11 +6825,7 @@ roaming:
 
 sorting:
if (need_sort) {
-   if (service_list->next) {
-   service_list = g_list_sort(service_list,
-   service_compare);
-   service_schedule_changed();
-   }
+   service_list_sort();
}
 }
 
-- 
1.8.5.3

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman