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 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 > > > > > ------------------------------ > > Message: 3 > Date: Tue, 18 Mar 2014 13:33:21 +0000 > From: Homam Dabis <hda...@digisoft.tv> > To: connman@connman.net > Subject: Tethering questions > Message-ID: > < > cak+sfou49+_yq-jzookzy_ep3nezc6p1naajfvmoowgkja8...@mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > 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 > > > ------------------------------ > > Message: 4 > Date: Tue, 18 Mar 2014 16:14:21 +0200 > From: Patrik Flykt <patrik.fl...@linux.intel.com> > To: connman@connman.net > Subject: Re: Tethering questions > Message-ID: <1395152061.15951.236.camel@pflykt-mobl1> > Content-Type: text/plain; charset="UTF-8" > > On Tue, 2014-03-18 at 13:33 +0000, 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 > > > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > connman mailing list > connman@connman.net > https://lists.connman.net/mailman/listinfo/connman > > ------------------------------ > > End of connman Digest, Vol 62, Issue 19 > *************************************** > _______________________________________________ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman