Send connman mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."
Today's Topics:
1. Fwd: [PATCH v2] service: state transition to configuration
(Naveen Singh)
2. Iptable usage in Connman (Lamsoge, Abhijit)
3. Re: Iptable usage in Connman (Patrik Flykt)
4. Re: [PATCH v2] service: state transition to configuration
(Patrik Flykt)
5. [RFC] service: Move service to state ready if defaultroute is
removed (Patrik Flykt)
6. Re: [PATCH v2] service: state transition to configuration
(Naveen Singh)
----------------------------------------------------------------------
Message: 1
Date: Tue, 12 Jan 2016 16:20:12 -0800
From: Naveen Singh <[email protected]>
To: [email protected]
Subject: Fwd: [PATCH v2] service: state transition to configuration
Message-ID:
<cagtdzkmcjnh-adbayaqucccwwmzfcmje3pjgnrxuzbijbvw...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi Patrik
Looks like this patch was lost somewhere in your email over holidays. Can
you have a look? This is about service state machine transitioning to
Configuration when lease if lost
Regards
Naveen
---------- Forwarded message ----------
From: Naveen Singh <[email protected]>
Date: Mon, Dec 28, 2015 at 12:49 AM
Subject: [PATCH v2] service: state transition to configuration
To: [email protected]
From: nasingh <[email protected]>
When the DHCP renewal fails dhcp_failure is called which in turn calls
__connman_connection_gateway_remove. This function unlike its
counterpart (__connman_connection_gateway_add which does the
service transition to READY) does not the change the state to
CONFIGURATION. This causes the service state to be stuck at ONLINE.
---
src/connection.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/connection.c b/src/connection.c
index aa4e1c0..3cb428c 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -1014,6 +1014,16 @@ void __connman_connection_gateway_remove(struct
connman_service *service,
if (data)
set_default_gateway(data, type);
}
+
+ if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
+ __connman_service_ipconfig_indicate_state(service,
+ CONNMAN_SERVICE_STATE_CONFIGURATION,
+ CONNMAN_IPCONFIG_TYPE_IPV4);
+
+ if (type == CONNMAN_IPCONFIG_TYPE_IPV6)
+ __connman_service_ipconfig_indicate_state(service,
+ CONNMAN_SERVICE_STATE_CONFIGURATION,
+ CONNMAN_IPCONFIG_TYPE_IPV6);
}
bool __connman_connection_update_gateway(void)
--
2.6.0.rc2.230.g3dd15c0
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.01.org/pipermail/connman/attachments/20160112/3a2338af/attachment-0001.html>
------------------------------
Message: 2
Date: Wed, 13 Jan 2016 05:36:15 +0000
From: "Lamsoge, Abhijit" <[email protected]>
To: "[email protected]" <[email protected]>
Subject: Iptable usage in Connman
Message-ID:
<3261e8fc74193743a7498db5c1deb85ea051c...@hikawsexmb01.ad.harman.com>
Content-Type: text/plain; charset="iso-8859-1"
Hi Patrick,
I have few questions regarding IPtable functionality provided by Connman.
1) Does connman currently have support to call iptables functions from an
external application over DBUS ?
2) I can see here that, connman iptable is used only in context of firewall
related stuff and session/nat , is this true ?
3) Suppose I want to just set a specific rule like "iptables -A INPUT -s
xxx.xxx.xxx.xxx -j DROP" from external application what needs to be done ?
4) Test application in tools directory like iptables-test, is linked while
compiling connman, how about an separate application which does not link to
connman and still is able to call connman IPtable API's , say over Dbus or
something else, what needs to be done in this case ?
5) I think, firewall rules are set in context of connman use cases and
currently user defined rules cannot be specified, is this true ?
Thanks.
Abhijit
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.01.org/pipermail/connman/attachments/20160113/ec8484c2/attachment-0001.html>
------------------------------
Message: 3
Date: Wed, 13 Jan 2016 09:33:51 +0200
From: Patrik Flykt <[email protected]>
To: "Lamsoge, Abhijit" <[email protected]>
Cc: "[email protected]" <[email protected]>
Subject: Re: Iptable usage in Connman
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"
On Wed, 2016-01-13 at 05:36 +0000, Lamsoge, Abhijit wrote:
> Hi Patrick,
> I have few questions regarding IPtable functionality provided by
> Connman.
>
> 1) Does connman currently have support to call iptables functions from
> an external application over DBUS ?
No.
> 2) I can see here that, connman iptable is used only in context of
> firewall related stuff and session/nat , is this true ?
iptables functionality is used only for session and nat. ConnMan uses
"higher level" functions called connman_firewall_* to achieve that.
> 3) Suppose I want to just set a specific rule like "iptables -A INPUT
> -s xxx.xxx.xxx.xxx -j DROP" from external application what needs to be
> done ?
Not possible via ConnMan, no D-Bus API to do this.
> 4) Test application in tools directory like iptables-test, is linked
> while compiling connman, how about an separate application which does
> not link to connman and still is able to call connman IPtable API's ,
> say over Dbus or something else, what needs to be done in this case ?
There is no D-Bus API to do this.
> 5) I think, firewall rules are set in context of connman use cases and
> currently user defined rules cannot be specified, is this true ?
Yes.
Patrik
------------------------------
Message: 4
Date: Wed, 13 Jan 2016 12:58:26 +0200
From: Patrik Flykt <[email protected]>
To: Naveen Singh <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH v2] service: state transition to configuration
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"
Hi,
On Mon, 2015-12-28 at 00:49 -0800, Naveen Singh wrote:
> From: nasingh <[email protected]>
>
> When the DHCP renewal fails dhcp_failure is called which in turn calls
> __connman_connection_gateway_remove. This function unlike its
> counterpart (__connman_connection_gateway_add which does the
> service transition to READY) does not the change the state to
> CONFIGURATION. This causes the service state to be stuck at ONLINE.
> ---
> src/connection.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/src/connection.c b/src/connection.c
> index aa4e1c0..3cb428c 100644
> --- a/src/connection.c
> +++ b/src/connection.c
> @@ -1014,6 +1014,16 @@ void __connman_connection_gateway_remove(struct
> connman_service *service,
> if (data)
> set_default_gateway(data, type);
> }
> +
> + if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
> + __connman_service_ipconfig_indicate_state(service,
> + CONNMAN_SERVICE_STATE_CONFIGURATION,
> + CONNMAN_IPCONFIG_TYPE_IPV4);
> +
> + if (type == CONNMAN_IPCONFIG_TYPE_IPV6)
> + __connman_service_ipconfig_indicate_state(service,
> + CONNMAN_SERVICE_STATE_CONFIGURATION,
> + CONNMAN_IPCONFIG_TYPE_IPV6);
> }
>
> bool __connman_connection_update_gateway(void)
This does not look right. A service can still be in state 'ready' even
if it is missing a gateway. The service transition needs to be done
elsewhere, perhaps in dhcp_failure(). The current
__connman_connection_gateway_add() doing service transitions doesn't
look right either.
Cheers,
Patrik
------------------------------
Message: 5
Date: Wed, 13 Jan 2016 14:57:12 +0200
From: Patrik Flykt <[email protected]>
To: [email protected], [email protected]
Subject: [RFC] service: Move service to state ready if defaultroute is
removed
Message-ID:
<[email protected]>
When the default route is removed, it is more than likely that the
corresponding service cannot be in state online anymore. Downgrade
the affected service state. This in turn will trigger a new online
check and resolve the state back to online if at all possible.
---
This might fix the issue with dhcp_failure() reported by Naveen Singh.
Please test!
Patrik
src/service.c | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/src/service.c b/src/service.c
index abf0899..3fa5ae5 100644
--- a/src/service.c
+++ b/src/service.c
@@ -6380,12 +6380,27 @@ static void service_ip_release(struct connman_ipconfig
*ipconfig,
settings_changed(service, ipconfig);
}
-static void service_route_changed(struct connman_ipconfig *ipconfig,
+static void service_defaultroute_set(struct connman_ipconfig *ipconfig,
const char *ifname)
{
struct connman_service *service = __connman_ipconfig_get_data(ipconfig);
- DBG("%s route changed", ifname);
+ DBG("service %p %s defaultroute set", service, ifname);
+
+ settings_changed(service, ipconfig);
+}
+
+static void service_defaultroute_unset(struct connman_ipconfig *ipconfig,
+ const char *ifname)
+{
+ struct connman_service *service = __connman_ipconfig_get_data(ipconfig);
+
+ DBG("service %p %s defaultroute unset", service, ifname);
+
+ if (service->state == CONNMAN_SERVICE_STATE_ONLINE)
+ __connman_service_ipconfig_indicate_state(service,
+ CONNMAN_SERVICE_STATE_READY,
+ __connman_ipconfig_get_config_type(ipconfig));
settings_changed(service, ipconfig);
}
@@ -6397,8 +6412,8 @@ static const struct connman_ipconfig_ops service_ops = {
.lower_down = service_lower_down,
.ip_bound = service_ip_bound,
.ip_release = service_ip_release,
- .route_set = service_route_changed,
- .route_unset = service_route_changed,
+ .route_set = service_defaultroute_set,
+ .route_unset = service_defaultroute_unset,
};
static struct connman_ipconfig *create_ip4config(struct connman_service
*service,
--
2.1.4
------------------------------
Message: 6
Date: Wed, 13 Jan 2016 10:53:45 -0800
From: Naveen Singh <[email protected]>
To: Patrik Flykt <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH v2] service: state transition to configuration
Message-ID:
<CAFK1zRAL=gojykskn6w8a2ax_i4stbkl4d3wxcbogg1jxp2...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Wed, Jan 13, 2016 at 2:58 AM, Patrik Flykt <[email protected]>
wrote:
>
> Hi,
>
> On Mon, 2015-12-28 at 00:49 -0800, Naveen Singh wrote:
> > From: nasingh <[email protected]>
> >
> > When the DHCP renewal fails dhcp_failure is called which in turn calls
> > __connman_connection_gateway_remove. This function unlike its
> > counterpart (__connman_connection_gateway_add which does the
> > service transition to READY) does not the change the state to
> > CONFIGURATION. This causes the service state to be stuck at ONLINE.
> > ---
> > src/connection.c | 10 ++++++++++
> > 1 file changed, 10 insertions(+)
> >
> > diff --git a/src/connection.c b/src/connection.c
> > index aa4e1c0..3cb428c 100644
> > --- a/src/connection.c
> > +++ b/src/connection.c
> > @@ -1014,6 +1014,16 @@ void __connman_connection_gateway_remove(struct
> connman_service *service,
> > if (data)
> > set_default_gateway(data, type);
> > }
> > +
> > + if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
> > + __connman_service_ipconfig_indicate_state(service,
> > + CONNMAN_SERVICE_STATE_CONFIGURATION,
> > + CONNMAN_IPCONFIG_TYPE_IPV4);
> > +
> > + if (type == CONNMAN_IPCONFIG_TYPE_IPV6)
> > + __connman_service_ipconfig_indicate_state(service,
> > + CONNMAN_SERVICE_STATE_CONFIGURATION,
> > + CONNMAN_IPCONFIG_TYPE_IPV6);
> > }
> >
> > bool __connman_connection_update_gateway(void)
>
> This does not look right. A service can still be in state 'ready' even
> if it is missing a gateway. The service transition needs to be done
> elsewhere, perhaps in dhcp_failure(). The current
> __connman_connection_gateway_add() doing service transitions doesn't
> look right either.
>
I understand. I added this change in service_ip_release call back but it
has side-effects in case when device gets a valid IPv4 address after having
a 169 Link local. Following is the order of events:
1. Device gets a link local address and service IPv4 state changes to ready
2. Device keeps on sending discover request to look for a valid DHCP server
3. Once it finds a DHCP server, it goes through the normal state machine of
DHCP and gets an IPv4 address and state transition is done to ready.
4. Now once we have a valid IPv4 address we delete 169 address which would
again end up calling service_ip_release and state would go back to
configuration.
> Cheers,
>
> Patrik
>
> _______________________________________________
> connman mailing list
> [email protected]
> https://lists.01.org/mailman/listinfo/connman
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.01.org/pipermail/connman/attachments/20160113/e9a35673/attachment.html>
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 3, Issue 8
*************************************