[PATCH 0/2] ofono IPv6 patching

2015-02-09 Thread pasi . sjoholm
From: Pasi Sjöholm pasi.sjoh...@jollamobile.com

These two patches are additional work againts
[RFC] ofono: Set ipconfig off if indicated that the protocol is not used

Pasi Sjöholm (2):
  ofono: always set configuration method when connected
  ofono: do not reset method if its _OFF

 plugins/ofono.c | 23 +--
 1 file changed, 13 insertions(+), 10 deletions(-)

-- 
2.1.0

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

[PATCH 1/2] ofono: always set configuration method when connected

2015-02-09 Thread pasi . sjoholm
From: Pasi Sjöholm pasi.sjoh...@jollamobile.com

If configuration method is not always set the ConnMan
will use previously set configuration from previous
connections.
---
 plugins/ofono.c | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/plugins/ofono.c b/plugins/ofono.c
index fabbf7c..b79cb0c 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -277,12 +277,11 @@ static void set_connected(struct modem_data *modem)
if (!service)
return;
 
-   if (method == CONNMAN_IPCONFIG_METHOD_FIXED ||
-   method == CONNMAN_IPCONFIG_METHOD_DHCP) {
-   connman_service_create_ip4config(service, index);
-
-   connman_network_set_ipv4_method(modem-network, method);
+   connman_service_create_ip4config(service, index);
+   connman_network_set_ipv4_method(modem-network, method);
 
+   if (method == CONNMAN_IPCONFIG_METHOD_FIXED ||
+   method == CONNMAN_IPCONFIG_METHOD_DHCP) {
setip = true;
}
 
@@ -292,10 +291,10 @@ static void set_connected(struct modem_data *modem)
}
 
method = modem-context-ipv6_method;
-   if (method == CONNMAN_IPCONFIG_METHOD_AUTO) {
-   connman_service_create_ip6config(service, index);
-   connman_network_set_ipv6_method(modem-network, method);
+   connman_service_create_ip6config(service, index);
+   connman_network_set_ipv6_method(modem-network, method);
 
+   if (method == CONNMAN_IPCONFIG_METHOD_AUTO) {
setip = true;
}
 
-- 
2.1.0

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

[PATCH 2/2] ofono: do not reset method if its _OFF

2015-02-09 Thread pasi . sjoholm
From: Pasi Sjöholm pasi.sjoh...@jollamobile.com

Method must not be reset from _OFF when disconnecting
but only through Protocol-message handling.
---
 plugins/ofono.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/plugins/ofono.c b/plugins/ofono.c
index b79cb0c..d18130e 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -330,11 +330,15 @@ static void set_disconnected(struct modem_data *modem)
if (modem-context) {
g_free(modem-context-ipv4_nameservers);
modem-context-ipv4_nameservers = NULL;
-   modem-context-ipv4_method = CONNMAN_IPCONFIG_METHOD_UNKNOWN;
+   if (modem-context-ipv4_method != CONNMAN_IPCONFIG_METHOD_OFF)
+   modem-context-ipv4_method =
+   CONNMAN_IPCONFIG_METHOD_UNKNOWN;
 
g_free(modem-context-ipv6_nameservers);
modem-context-ipv6_nameservers = NULL;
-   modem-context-ipv6_method = CONNMAN_IPCONFIG_METHOD_UNKNOWN;
+   if (modem-context-ipv6_method != CONNMAN_IPCONFIG_METHOD_OFF)
+   modem-context-ipv6_method =
+   CONNMAN_IPCONFIG_METHOD_UNKNOWN;
}
 }
 
-- 
2.1.0

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

Re: [RFC] ofono: Set ipconfig off if indicated that the protocol is not used

2015-02-09 Thread Pasi Sjöholm


On 09.02.2015 10:00, Pasi Sjöholm wrote:

 Otherwise everything else looks ok, but Protocol-message will never
 happen when modem-active is true. At least I don't have a modem which
 would allow changing protocol when modem is connected.

And by this I mean the two lines below could be removed. :)

 +if (modem-active)
 +set_connected(modem);

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


[PATCH] connmanctl: install binary with manpage to system when client is enabled

2015-02-09 Thread tcech
From: Tomáš Čech sleep_wal...@suse.cz

Until now neither connmanctl nor its main page were installed to target system
during `make install' phase. Distributions which adopted connman copied
connmanctl by hand manually. connmanctl is mature enough to be installed by
default when client build is enabled.
---
 Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index d37f275..709e827 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -237,9 +237,9 @@ script_LTLIBRARIES =
 include Makefile.plugins
 
 if CLIENT
-noinst_PROGRAMS += client/connmanctl
+bin_PROGRAMS += client/connmanctl
 
-noinst_MANUAL_PAGES = doc/connmanctl.1
+MANUAL_PAGES += doc/connmanctl.1
 
 client_connmanctl_SOURCES = client/dbus_helpers.h client/dbus_helpers.c \
client/services.h client/services.c \
-- 
2.2.2

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

Re: [RFC] ofono: Set ipconfig off if indicated that the protocol is not used

2015-02-09 Thread Pasi Sjöholm
On 06.02.2015 15:43, Patrik Flykt wrote:
 @@ -1261,6 +1312,17 @@ static gboolean context_changed(DBusConnection *conn,
  
   remove_network(modem);
   }
 +
 + } else if (g_str_equal(key, Protocol) 
 + dbus_message_iter_get_arg_type(value) == DBUS_TYPE_STRING ) {
 + const char *ip_protocol;
 +
 + dbus_message_iter_get_basic(value, ip_protocol);
 +
 + set_context_ipconfig(modem-context, ip_protocol);
 +
 + if (modem-active)
 + set_connected(modem);

Otherwise everything else looks ok, but Protocol-message will never
happen when modem-active is true. At least I don't have a modem which
would allow changing protocol when modem is connected.

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


[PATCH 2/3] network: fix eternal associating/connecting with IPv6-only

2015-02-09 Thread pasi . sjoholm
From: Pasi Sjöholm pasi.sjoh...@jollamobile.com

It was possible with IPv6-only networks to have eternal
associating/connecting variable set as true, especially
when ipv4 configuration method was OFF.
---
 src/network.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/network.c b/src/network.c
index db19cb9..d30520e 100644
--- a/src/network.c
+++ b/src/network.c
@@ -342,6 +342,8 @@ static int manual_ipv6_set(struct connman_network *network,
 
connman_device_set_disconnected(network-device, false);
 
+   connman_network_set_associating(network, false);
+
network-connecting = false;
 
return 0;
@@ -386,10 +388,6 @@ static int dhcpv6_set_addresses(struct connman_network 
*network)
if (!service)
goto err;
 
-   connman_network_set_associating(network, false);
-
-   network-connecting = false;
-
ipconfig_ipv6 = __connman_service_get_ip6config(service);
err = __connman_ipconfig_address_add(ipconfig_ipv6);
if (err  0)
@@ -511,6 +509,10 @@ static void check_dhcpv6(struct nd_router_advert *reply,
if (service) {
connman_service_create_ip6config(service, network-index);
 
+   network-connecting = false;
+
+   connman_network_set_associating(network, false);
+
__connman_service_ipconfig_indicate_state(service,
CONNMAN_SERVICE_STATE_CONFIGURATION,
CONNMAN_IPCONFIG_TYPE_IPV6);
-- 
2.1.0

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

[PATCH 1/3] network: disable IPv6 completely if method is off

2015-02-09 Thread pasi . sjoholm
From: Pasi Sjöholm pasi.sjoh...@jollamobile.com

If method is set off for IPv6 then it should be completely
disabled and not to allow kernel autoconfigure the addresses
for the service.
---
 src/network.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/network.c b/src/network.c
index 94440dc..db19cb9 100644
--- a/src/network.c
+++ b/src/network.c
@@ -650,8 +650,9 @@ static void set_connected(struct connman_network *network)
 
switch (ipv6_method) {
case CONNMAN_IPCONFIG_METHOD_UNKNOWN:
-   case CONNMAN_IPCONFIG_METHOD_OFF:
break;
+   case CONNMAN_IPCONFIG_METHOD_OFF:
+   __connman_ipconfig_disable_ipv6(ipconfig_ipv6);
case CONNMAN_IPCONFIG_METHOD_DHCP:
case CONNMAN_IPCONFIG_METHOD_AUTO:
autoconf_ipv6_set(network);
@@ -1680,8 +1681,9 @@ int __connman_network_set_ipconfig(struct connman_network 
*network,
 
switch (method) {
case CONNMAN_IPCONFIG_METHOD_UNKNOWN:
-   case CONNMAN_IPCONFIG_METHOD_OFF:
break;
+   case CONNMAN_IPCONFIG_METHOD_OFF:
+   __connman_ipconfig_disable_ipv6(ipconfig_ipv6);
case CONNMAN_IPCONFIG_METHOD_AUTO:
autoconf_ipv6_set(network);
break;
-- 
2.1.0

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

[PATCH 3/3] network: make sure that IPv6 is enabled with autoconfiguration

2015-02-09 Thread pasi . sjoholm
From: Pasi Sjöholm pasi.sjoh...@jollamobile.com

Previously IPv6 enabled with manual_ipv6_net but not with
autoconfiguration.
---
 src/network.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/network.c b/src/network.c
index d30520e..3a52285 100644
--- a/src/network.c
+++ b/src/network.c
@@ -614,6 +614,8 @@ static void autoconf_ipv6_set(struct connman_network 
*network)
if (!ipconfig)
return;
 
+   __connman_ipconfig_enable_ipv6(ipconfig);
+
__connman_ipconfig_address_remove(ipconfig);
 
index = __connman_ipconfig_get_index(ipconfig);
-- 
2.1.0

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

[PATCH 0/3] various IPv6 fixes

2015-02-09 Thread pasi . sjoholm
From: Pasi Sjöholm pasi.sjoh...@jollamobile.com

Found these problems while playing with IPv4/6-only connections while
other ip-version method is set to OFF.

Pasi Sjöholm (3):
  network: disable IPv6 completely if method is off
  network: fix eternal associating/connecting with IPv6-only
  network: make sure that IPv6 is enabled with autoconfiguration

 src/network.c | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

-- 
2.1.0

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