Re: [PATCH] tethering: fix issue tether bridge may not be destroied

2014-03-18 Thread Patrik Flykt

Hi,

On Tue, 2014-03-18 at 12:00 +0800, Guoqiang Liu wrote:
 From: Guoqiang Liu guoqiang@archermind.com
 
 ConnMan use a volatile variable tethering_enabled to count
 the tether bridge users. and only destroy the tether bridge
 when tethering_enabled is 0.
 
 If two or more technologies turn on tethering at the same
 times, and then turn off all the technologies' tethering
 featrue, the tethering_enabled will only -1.
 
 The reason is ConnMan use __connman_tethering_set_disabled
 to decrease tethering_enabled. and the function will be
 invoked only when there is no technology with techering
 feature on in technology_list, when two or more technologeis
 turn off tethering, only last one can decrease tethering_enabled.
 ---
  src/technology.c |   13 ++---
  src/tethering.c  |6 +++---
  2 files changed, 5 insertions(+), 14 deletions(-)
 
 diff --git a/src/technology.c b/src/technology.c
 index ce922be..28ea3c6 100644
 --- a/src/technology.c
 +++ b/src/technology.c
 @@ -290,8 +290,6 @@ static void tethering_changed(struct connman_technology 
 *technology)
  void connman_technology_tethering_notify(struct connman_technology 
 *technology,
   bool enabled)
  {
 - GSList *list;
 -
   DBG(technology %p enabled %u, technology, enabled);
  
   if (technology-tethering == enabled)
 @@ -303,15 +301,8 @@ void connman_technology_tethering_notify(struct 
 connman_technology *technology,
  
   if (enabled)
   __connman_tethering_set_enabled();
 - else {
 - for (list = technology_list; list; list = list-next) {
 - struct connman_technology *other_tech = list-data;
 - if (other_tech-tethering)
 - break;
 - }
 - if (!list)
 - __connman_tethering_set_disabled();
 - }
 + else
 + __connman_tethering_set_disabled();
  }
  
  static int set_tethering(struct connman_technology *technology,

Please split up this patch into two parts. The second patch is the code
above, it lets __connman_tethering_set_disabled() properly keep track of
the number of tethering technologies.

 diff --git a/src/tethering.c b/src/tethering.c
 index 6a9690b..c7e17f5 100644
 --- a/src/tethering.c
 +++ b/src/tethering.c
 @@ -293,14 +293,14 @@ void __connman_tethering_set_disabled(void)
  
   DBG(enabled %d, tethering_enabled - 1);
  
 + if (__sync_fetch_and_sub(tethering_enabled, 1) != 1)
 + return;
 +
   __connman_ipv6pd_cleanup();
  
   index = connman_inet_ifindex(BRIDGE_NAME);
   __connman_dnsproxy_remove_listener(index);
  
 - if (__sync_fetch_and_sub(tethering_enabled, 1) != 1)
 - return;
 -
   __connman_nat_disable(BRIDGE_NAME);
  
   dhcp_server_stop(tethering_dhcp_server);

This lower part is the first patch. It ensures that all the features of
the bridge are kept enabled as long as needed (and not remove dnsproxy
or IPv6 prefix delegation too early).

Cheers,

Patrik


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


Tethering questions

2014-03-18 Thread Homam Dabis
I have 2 questions regarding wifi tethering

1. If I have 2 active interfaces (ppp and ethernet) is it possible to
specify tethering between wifi and the ppp interface?

2. Is it possible to specify the IP range that the connman dhcp server
hands out?

Thanks

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


Re: Tethering questions

2014-03-18 Thread Patrik Flykt
On Tue, 2014-03-18 at 13:33 +, Homam Dabis wrote:
 1. If I have 2 active interfaces (ppp and ethernet) is it possible to
 specify tethering between wifi and the ppp interface?

One only specifies which interfaces are used for tethering, not the
direction. The default route out from the device uses the existing
uplink.

 2. Is it possible to specify the IP range that the connman dhcp
 server hands out?

No.

Patrik



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


Re: Tethering questions

2014-03-18 Thread Homam Dabis
Ok thanks. One more question re tethering configuration:

Everytime I am disabling an re-enabling tethering using dbus commands, I am
getting a different IP range (192.168.0.1 - 192.168.1.1 - 192.168.?.1).
Is this the way connman is suppose to behave?

Homam

On 18 March 2014 19:00, connman-requ...@connman.net wrote:

 Send connman mailing list submissions to
 connman@connman.net

 To subscribe or unsubscribe via the World Wide Web, visit
 https://lists.connman.net/mailman/listinfo/connman
 or, via email, send a message with subject or body 'help' to
 connman-requ...@connman.net

 You can reach the person managing the list at
 connman-ow...@connman.net

 When replying, please edit your Subject line so it is more specific
 than Re: Contents of connman digest...


 Today's Topics:

1. [PATCH] tethering: fix issue tether bridge may not be
   destroied (Guoqiang Liu)
2. Re: [PATCH] tethering: fix issue tether bridge may not be
   destroied (Patrik Flykt)
3. Tethering questions (Homam Dabis)
4. Re: Tethering questions (Patrik Flykt)


 --

 Message: 1
 Date: Tue, 18 Mar 2014 12:00:29 +0800
 From: Guoqiang Liu leonewc...@gmail.com
 To: connman@connman.net,patrik.fl...@linux.intel.com
 Cc: guoqiang@archermind.com
 Subject: [PATCH] tethering: fix issue tether bridge may not be
 destroied
 Message-ID:
 1395115229-20473-1-git-send-email-guoqiang@archermind.com

 From: Guoqiang Liu guoqiang@archermind.com

 ConnMan use a volatile variable tethering_enabled to count
 the tether bridge users. and only destroy the tether bridge
 when tethering_enabled is 0.

 If two or more technologies turn on tethering at the same
 times, and then turn off all the technologies' tethering
 featrue, the tethering_enabled will only -1.

 The reason is ConnMan use __connman_tethering_set_disabled
 to decrease tethering_enabled. and the function will be
 invoked only when there is no technology with techering
 feature on in technology_list, when two or more technologeis
 turn off tethering, only last one can decrease tethering_enabled.
 ---
  src/technology.c |   13 ++---
  src/tethering.c  |6 +++---
  2 files changed, 5 insertions(+), 14 deletions(-)

 diff --git a/src/technology.c b/src/technology.c
 index ce922be..28ea3c6 100644
 --- a/src/technology.c
 +++ b/src/technology.c
 @@ -290,8 +290,6 @@ static void tethering_changed(struct
 connman_technology *technology)
  void connman_technology_tethering_notify(struct connman_technology
 *technology,
 bool enabled)
  {
 -   GSList *list;
 -
 DBG(technology %p enabled %u, technology, enabled);

 if (technology-tethering == enabled)
 @@ -303,15 +301,8 @@ void connman_technology_tethering_notify(struct
 connman_technology *technology,

 if (enabled)
 __connman_tethering_set_enabled();
 -   else {
 -   for (list = technology_list; list; list = list-next) {
 -   struct connman_technology *other_tech = list-data;
 -   if (other_tech-tethering)
 -   break;
 -   }
 -   if (!list)
 -   __connman_tethering_set_disabled();
 -   }
 +   else
 +   __connman_tethering_set_disabled();
  }

  static int set_tethering(struct connman_technology *technology,
 diff --git a/src/tethering.c b/src/tethering.c
 index 6a9690b..c7e17f5 100644
 --- a/src/tethering.c
 +++ b/src/tethering.c
 @@ -293,14 +293,14 @@ void __connman_tethering_set_disabled(void)

 DBG(enabled %d, tethering_enabled - 1);

 +   if (__sync_fetch_and_sub(tethering_enabled, 1) != 1)
 +   return;
 +
 __connman_ipv6pd_cleanup();

 index = connman_inet_ifindex(BRIDGE_NAME);
 __connman_dnsproxy_remove_listener(index);

 -   if (__sync_fetch_and_sub(tethering_enabled, 1) != 1)
 -   return;
 -
 __connman_nat_disable(BRIDGE_NAME);

 dhcp_server_stop(tethering_dhcp_server);
 --
 1.7.9.5



 --

 Message: 2
 Date: Tue, 18 Mar 2014 14:43:08 +0200
 From: Patrik Flykt patrik.fl...@linux.intel.com
 To: Guoqiang Liu leonewc...@gmail.com
 Cc: connman@connman.net, guoqiang@archermind.com
 Subject: Re: [PATCH] tethering: fix issue tether bridge may not be
 destroied
 Message-ID: 1395146588.15951.232.camel@pflykt-mobl1
 Content-Type: text/plain; charset=UTF-8


 Hi,

 On Tue, 2014-03-18 at 12:00 +0800, Guoqiang Liu wrote:
  From: Guoqiang Liu guoqiang@archermind.com
 
  ConnMan use a volatile variable tethering_enabled to count
  the tether bridge users. and only destroy the tether bridge
  when tethering_enabled is 0.
 
  If two or more technologies turn on tethering at the same
  times, and then turn off all the 

[PATCH 1/1] Fix typo p2p-on-supplicant

2014-03-18 Thread Eduardo Abinader
fix typo on p2p_service_flush
---
 test/p2p-on-supplicant | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/p2p-on-supplicant b/test/p2p-on-supplicant
index 2bb02ba..b59c11c 100755
--- a/test/p2p-on-supplicant
+++ b/test/p2p-on-supplicant
@@ -374,7 +374,7 @@ class Wpa_s:
 self.p2p.DeleteService((service))
 
 @checkarg()
-def p2p_service_flush(self, args = None)
+def p2p_service_flush(self, args = None):
 if not self.p2p:
 return
 
-- 
1.8.3.2

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


Re: Tethering questions

2014-03-18 Thread Chengyi Zhao
Hi,


2014-03-19 3:26 GMT+08:00 Homam Dabis hda...@digisoft.tv:

 Ok thanks. One more question re tethering configuration:

 Everytime I am disabling an re-enabling tethering using dbus commands, I am
 getting a different IP range (192.168.0.1 - 192.168.1.1 - 192.168.?.1).
 Is this the way connman is suppose to behave?

 Yes, this is ConnMan design, maybe it has some issues.

If you'd like, please track this issue https://01.org/jira/browse/CM-618;

Cheers,

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