ConnMan network manager
 help / color / Atom feed
* [PATCH] service: Ignore state information in service reordering
@ 2021-06-23 14:58 VAUTRIN Emmanuel (Canal Plus Prestataire)
  2021-07-02  7:53 ` Daniel Wagner
  0 siblings, 1 reply; 6+ messages in thread
From: VAUTRIN Emmanuel (Canal Plus Prestataire) @ 2021-06-23 14:58 UTC (permalink / raw)
  To: connman

The states of the default and new services shall not impact
the preferred service reordering.
---
 src/service.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/service.c b/src/service.c
index 13f619be7066..222f811c2690 100644
--- a/src/service.c
+++ b/src/service.c
@@ -5894,8 +5894,7 @@ static int service_update_preferred_order(struct connman_service *default_servic
 	unsigned int *tech_array;
 	int i;
 
-	if (!default_service || default_service == new_service ||
-			default_service->state != new_state)
+	if (!default_service || default_service == new_service)
 		return 0;
 
 	tech_array = connman_setting_get_uint_list("PreferredTechnologies");
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] service: Ignore state information in service reordering
  2021-06-23 14:58 [PATCH] service: Ignore state information in service reordering VAUTRIN Emmanuel (Canal Plus Prestataire)
@ 2021-07-02  7:53 ` Daniel Wagner
  2021-07-02  8:13   ` VAUTRIN Emmanuel (Canal Plus Prestataire)
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Wagner @ 2021-07-02  7:53 UTC (permalink / raw)
  To: VAUTRIN Emmanuel (Canal Plus Prestataire); +Cc: connman

Hi Emmanuel,

On Wed, Jun 23, 2021 at 02:58:00PM +0000, VAUTRIN Emmanuel (Canal Plus Prestataire) wrote:
> The states of the default and new services shall not impact
> the preferred service reordering.

I suspect this one is needed to the moving of the
update_default(). Let's first figure out why you need the first patch.

Thanks,
Daniel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] service: Ignore state information in service reordering
  2021-07-02  7:53 ` Daniel Wagner
@ 2021-07-02  8:13   ` VAUTRIN Emmanuel (Canal Plus Prestataire)
  2021-07-02  8:37     ` Daniel Wagner
  0 siblings, 1 reply; 6+ messages in thread
From: VAUTRIN Emmanuel (Canal Plus Prestataire) @ 2021-07-02  8:13 UTC (permalink / raw)
  To: Daniel Wagner; +Cc: connman

> I suspect this one is needed to the moving of the
> update_default(). Let's first figure out why you need the first patch.
Daniel,

The involved states are "online" and "ready", so it is irrelevant
to take them into account here.

Best Regards,

Emmanuel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] service: Ignore state information in service reordering
  2021-07-02  8:13   ` VAUTRIN Emmanuel (Canal Plus Prestataire)
@ 2021-07-02  8:37     ` Daniel Wagner
  2021-07-02 15:19       ` VAUTRIN Emmanuel (Canal Plus Prestataire)
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Wagner @ 2021-07-02  8:37 UTC (permalink / raw)
  To: VAUTRIN Emmanuel (Canal Plus Prestataire); +Cc: connman

On Fri, Jul 02, 2021 at 08:13:27AM +0000, VAUTRIN Emmanuel (Canal Plus Prestataire) wrote:
> The involved states are "online" and "ready", so it is irrelevant
> to take them into account here.

So you are saying we should check the order independent of the
states. Hmm, without VPN Services I'd say you are right, but let me
think this through with VPN in mind.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] service: Ignore state information in service reordering
  2021-07-02  8:37     ` Daniel Wagner
@ 2021-07-02 15:19       ` VAUTRIN Emmanuel (Canal Plus Prestataire)
  2021-07-06  7:19         ` Daniel Wagner
  0 siblings, 1 reply; 6+ messages in thread
From: VAUTRIN Emmanuel (Canal Plus Prestataire) @ 2021-07-02 15:19 UTC (permalink / raw)
  To: Daniel Wagner; +Cc: connman

> So you are saying we should check the order independent of the
> states. Hmm, without VPN Services I'd say you are right, but let me
> think this through with VPN in mind.
Indeed. I have not checked the VPN part.
I will develop my point.
With the following context:
* PreferredTechnologies=ethernet,wifi
* Ethernet (E) unplugged,
* Wifi (W) network connected and online.
when plugging the Ethernet, we have
default_service: W, default_service->state: ONLINE.
new_service: E, new_state: READY
So default_service->state != new_state, the service list
is not updated, as required.
If the state still matters for VPN part, maybe it will be cleaner
to call is_connected() instead of checking the state itself.


Best Regards,

Emmanuel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] service: Ignore state information in service reordering
  2021-07-02 15:19       ` VAUTRIN Emmanuel (Canal Plus Prestataire)
@ 2021-07-06  7:19         ` Daniel Wagner
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Wagner @ 2021-07-06  7:19 UTC (permalink / raw)
  To: VAUTRIN Emmanuel (Canal Plus Prestataire); +Cc: connman

Hi Emmanuel,

On Fri, Jul 02, 2021 at 03:19:28PM +0000, VAUTRIN Emmanuel (Canal Plus Prestataire) wrote:
> If the state still matters for VPN part, maybe it will be cleaner
> to call is_connected() instead of checking the state itself.

Thanks for the explanation. Indeed if the service needs to be connected
then using is_connected() will clearly document this. I need do to test
this a bit first though.

Thannks,
Daniel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23 14:58 [PATCH] service: Ignore state information in service reordering VAUTRIN Emmanuel (Canal Plus Prestataire)
2021-07-02  7:53 ` Daniel Wagner
2021-07-02  8:13   ` VAUTRIN Emmanuel (Canal Plus Prestataire)
2021-07-02  8:37     ` Daniel Wagner
2021-07-02 15:19       ` VAUTRIN Emmanuel (Canal Plus Prestataire)
2021-07-06  7:19         ` Daniel Wagner

ConnMan network manager

Archives are clonable:
	git clone --mirror https://lore.kernel.org/connman/0 connman/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 connman connman/ https://lore.kernel.org/connman \
		connman@lists.linux.dev
	public-inbox-index connman

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/dev.linux.lists.connman


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git