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. Crash in connman_session_set_default_config when changing
session policy file (Daryl Nebrich)
2. Re: Query regarding cellular data connection with connman via
ofono (Naveen Kumar Danturi)
3. [PATCH] conf: Allow to configure status check URLs (Slava Monich)
4. Re: [PATCH] conf: Allow to configure status check URLs
(Marcel Holtmann)
5. [PATCH v3 0/8] session: Add per-interface routing
([email protected])
6. [PATCH v3 1/8] session: Fix default route for ppp services
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Wed, 25 Jan 2017 09:38:05 -0500
From: Daryl Nebrich <[email protected]>
To: [email protected]
Subject: Crash in connman_session_set_default_config when changing
session policy file
Message-ID:
<CANmGHYv7+T0iYHn1UyUeYmitsRjtA=25ydh-ydpfvxy-unb...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Hi,
Using latest code, there's a crash that happens when I modify a
session policy file after connman has already started and loaded the
policy files. Below is the backtrace. I included a patch with a fix.
Looks like the g_slist config->allowed_bearers needs to be set to NULL
before it's reused.
Index: connman-9b07d2a/src/session.c
===================================================================
--- connman-9b07d2a.orig/src/session.c 2017-01-22 14:58:49.000000000 -0500
+++ connman-9b07d2a/src/session.c 2017-01-25 09:12:07.523856388 -0500
@@ -600,6 +600,7 @@
config->ecall = FALSE;
g_slist_free(config->allowed_bearers);
+ config->allowed_bearers = NULL;
add_default_bearer_types(&config->allowed_bearers);
}
Program received signal SIGSEGV, Segmentation fault.
g_slist_last (list=0x2 = {...}, list@entry=0xc208a8 = {...})
at /usr/src/debug/glib-2.0/1_2.44.1-r0/glib-2.44.1/glib/gslist.c:828
828 while (list->next)
(gdb) bt
#0 g_slist_last (list=0x2 = {...}, list@entry=0xc208a8 = {...})
at /usr/src/debug/glib-2.0/1_2.44.1-r0/glib-2.44.1/glib/gslist.c:828
#1 0x76e41cf0 in g_slist_append (list=<optimized out>, data=0x3)
at /usr/src/debug/glib-2.0/1_2.44.1-r0/glib-2.44.1/glib/gslist.c:219
#2 0x000ad8c4 in add_default_bearer_types (list=0xc28a60)
at
/home/daryl/working/mecs-yocto/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/connman/9b07d2a-r0/connman-9b07d2a/src/session.c:587
#3 0x000ad97c in connman_session_set_default_config (config=0xc28a48)
at
/home/daryl/working/mecs-yocto/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/connman/9b07d2a-r0/connman-9b07d2a/src/session.c:603
#4 0x000553e4 in set_default_config (user_data=0xc28a28)
at
/home/daryl/working/mecs-yocto/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/connman/9b07d2a-r0/connman-9b07d2a/plugins/session_policy_local.c:498
#5 0x76e41df8 in g_slist_foreach (list=<optimized out>,
list@entry=0xc20928 = {...}, func=0x553bc <set_default_config>,
user_data=user_data@entry=0x0)
at /usr/src/debug/glib-2.0/1_2.44.1-r0/glib-2.44.1/glib/gslist.c:878
#6 0x76e41e14 in g_slist_free_full (list=0xc20928 = {...},
free_func=<optimized out>)
at /usr/src/debug/glib-2.0/1_2.44.1-r0/glib-2.44.1/glib/gslist.c:172
#7 0x000555a4 in cleanup_group (user_data=0xc276b0)
at
/home/daryl/working/mecs-yocto/build/tmp/work/cortexa9hf-vfp-neon-poky-li---Type
<return> to continue, or q <return> to quit---
nux-gnueabi/connman/9b07d2a-r0/connman-9b07d2a/plugins/session_policy_local.c:529
#8 0x76e41df8 in g_slist_foreach (list=<optimized out>,
list@entry=0xc1d8d0 = {...}, func=0x55534 <cleanup_group>,
user_data=user_data@entry=0x0)
at /usr/src/debug/glib-2.0/1_2.44.1-r0/glib-2.44.1/glib/gslist.c:878
#9 0x76e41e14 in g_slist_free_full (list=0xc1d8d0 = {...},
free_func=<optimized out>)
at /usr/src/debug/glib-2.0/1_2.44.1-r0/glib-2.44.1/glib/gslist.c:172
#10 0x00055720 in cleanup_file (user_data=0xc0d1c8)
at
/home/daryl/working/mecs-yocto/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/connman/9b07d2a-r0/connman-9b07d2a/plugins/session_policy_local.c:552
#11 0x76e0fdc4 in g_hash_table_remove_internal (hash_table=0xc26b68 = {...},
key=0x7eec0ad8, notify=0)
at /usr/src/debug/glib-2.0/1_2.44.1-r0/glib-2.44.1/glib/ghash.c:1357
#12 0x00055e1c in notify_handler (event=0x7eec0ac8,
filename=0x7eec0ad8 "argus.policy")
at
/home/daryl/working/mecs-yocto/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/connman/9b07d2a-r0/connman-9b07d2a/plugins/session_policy_local.c:718
#13 0x000c1dfc in inotify_data (channel=0xc266c8, cond=G_IO_IN,
user_data=0xc26528)
---Type <return> to continue, or q <return> to quit---
at
/home/daryl/working/mecs-yocto/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/connman/9b07d2a-r0/connman-9b07d2a/src/inotify.c:122
#14 0x76e22670 in g_main_dispatch (context=0xc1d980)
at /usr/src/debug/glib-2.0/1_2.44.1-r0/glib-2.44.1/glib/gmain.c:3122
#15 g_main_context_dispatch (context=context@entry=0xc1d980)
at /usr/src/debug/glib-2.0/1_2.44.1-r0/glib-2.44.1/glib/gmain.c:3737
#16 0x76e22a08 in g_main_context_iterate (context=0xc1d980,
block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
at /usr/src/debug/glib-2.0/1_2.44.1-r0/glib-2.44.1/glib/gmain.c:3808
#17 0x76e22d64 in g_main_loop_run (loop=0xc071d8)
at /usr/src/debug/glib-2.0/1_2.44.1-r0/glib-2.44.1/glib/gmain.c:4002
#18 0x0005a66c in main (argc=1, argv=0x7eec0e14)
at
/home/daryl/working/mecs-yocto/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/connman/9b07d2a-r0/connman-9b07d2a/src/main.c:739
Thanks,
Daryl
------------------------------
Message: 2
Date: Wed, 25 Jan 2017 08:52:01 -0600
From: Naveen Kumar Danturi <[email protected]>
To: Daniel Wagner <[email protected]>
Cc: [email protected], Daryl Nebrich <[email protected]>
Subject: Re: Query regarding cellular data connection with connman via
ofono
Message-ID:
<can3fbzbq63-fzv71wqmd1zyj3pdbbfzqyg0jymfswcp5f_9...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Thanks for the info Daniel/Daryl.
---Naveen
On Jan 25, 2017 2:33 AM, "Daniel Wagner" <[email protected]> wrote:
Hi Naveen,
On 01/24/2017 11:52 PM, Naveen Kumar Danturi wrote:
> Actually we have just a cellular connection. So this means connman
> itself cannot update routing tables?
No, ConnMan maintains the routing table for you. It sounds like you
running into the same problem as Daryl describes. There seems to be
hickup if oFono doesn't let ConnMan know what the default gateway is.
Thanks,
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.01.org/pipermail/connman/attachments/20170125/d1622765/attachment-0001.html>
------------------------------
Message: 3
Date: Wed, 25 Jan 2017 17:46:45 +0200
From: Slava Monich <[email protected]>
To: [email protected]
Subject: [PATCH] conf: Allow to configure status check URLs
Message-ID: <[email protected]>
The keys in main.conf are "Ipv4StatusUrl" and "Ipv6StatusUrl"
for IPv4 and IPv6, respectively.
---
doc/connman.conf.5.in | 4 ++++
src/6to4.c | 5 ++---
src/main.c | 38 ++++++++++++++++++++++++++++++++++++++
src/wispr.c | 9 ++++-----
4 files changed, 48 insertions(+), 8 deletions(-)
diff --git a/doc/connman.conf.5.in b/doc/connman.conf.5.in
index 9b28aad..481e8f2 100644
--- a/doc/connman.conf.5.in
+++ b/doc/connman.conf.5.in
@@ -136,6 +136,10 @@ See RFC6343. Default value is false (as recommended by
RFC6343 section 4.1).
Set DHCP option 60 (Vendor Class ID) to the given string. This option can
be used by DHCP servers to identify specific clients without having to
rely on MAC address ranges, etc
+.BI Ipv4StatusUrl=url
+IPv4 status check URL. Default is http://ipv4.connman.net/online/status.html
+.BI Ipv6StatusUrl=url
+IPv6 status check URL. Default is http://ipv6.connman.net/online/status.html
.SH "EXAMPLE"
The following example configuration disables hostname updates and enables
ethernet tethering.
diff --git a/src/6to4.c b/src/6to4.c
index 71a2882..1784c5f 100644
--- a/src/6to4.c
+++ b/src/6to4.c
@@ -53,8 +53,6 @@ static unsigned int newlink_watch;
static unsigned int newlink_flags;
static int newlink_timeout_id;
-#define STATUS_URL "http://ipv6.connman.net/online/status.html"
-
#ifndef IP_DF
#define IP_DF 0x4000 /* Flag: "Don't Fragment" */
#endif
@@ -317,7 +315,8 @@ static void tun_newlink(unsigned flags, unsigned change,
void *user_data)
if (getenv("CONNMAN_WEB_DEBUG"))
g_web_set_debug(web, web_debug, "6to4");
- web_request_id = g_web_request_get(web, STATUS_URL,
+ web_request_id = g_web_request_get(web,
+ connman_option_get_string("Ipv6StatusUrl"),
web_result, NULL, NULL);
newlink_timeout(NULL);
diff --git a/src/main.c b/src/main.c
index 915c17e..999de44 100644
--- a/src/main.c
+++ b/src/main.c
@@ -41,6 +41,8 @@
#define DEFAULT_INPUT_REQUEST_TIMEOUT (120 * 1000)
#define DEFAULT_BROWSER_LAUNCH_TIMEOUT (300 * 1000)
+#define DEFAULT_IPV4_STATUS_URL "http://ipv4.connman.net/online/status.html"
+#define DEFAULT_IPV6_STATUS_URL "http://ipv6.connman.net/online/status.html"
#define MAINFILE "main.conf"
#define CONFIGMAINFILE CONFIGDIR "/" MAINFILE
@@ -78,6 +80,8 @@ static struct {
bool persistent_tethering_mode;
bool enable_6to4;
char *vendor_class_id;
+ char *ipv4_status_url;
+ char *ipv6_status_url;
} connman_settings = {
.bg_scan = true,
.pref_timeservers = NULL,
@@ -94,6 +98,8 @@ static struct {
.persistent_tethering_mode = false,
.enable_6to4 = false,
.vendor_class_id = NULL,
+ .ipv4_status_url = NULL,
+ .ipv6_status_url = NULL,
};
#define CONF_BG_SCAN "BackgroundScanning"
@@ -111,6 +117,8 @@ static struct {
#define CONF_PERSISTENT_TETHERING_MODE "PersistentTetheringMode"
#define CONF_ENABLE_6TO4 "Enable6to4"
#define CONF_VENDOR_CLASS_ID "VendorClassID"
+#define CONF_IPV4_STATUS_URL "Ipv4StatusUrl"
+#define CONF_IPV6_STATUS_URL "Ipv6StatusUrl"
static const char *supported_options[] = {
CONF_BG_SCAN,
@@ -128,6 +136,8 @@ static const char *supported_options[] = {
CONF_PERSISTENT_TETHERING_MODE,
CONF_ENABLE_6TO4,
CONF_VENDOR_CLASS_ID,
+ CONF_IPV4_STATUS_URL,
+ CONF_IPV6_STATUS_URL,
NULL
};
@@ -251,6 +261,8 @@ static void parse_config(GKeyFile *config)
char **str_list;
char **tethering;
char *vendor_class_id;
+ char *ipv4url;
+ char *ipv6url;
gsize len;
int timeout;
@@ -394,6 +406,20 @@ static void parse_config(GKeyFile *config)
connman_settings.vendor_class_id = vendor_class_id;
g_clear_error(&error);
+
+ ipv4url = g_key_file_get_string(config, "General",
+ CONF_IPV4_STATUS_URL, &error);
+ if (!error)
+ connman_settings.ipv4_status_url = ipv4url;
+
+ g_clear_error(&error);
+
+ ipv6url = g_key_file_get_string(config, "General",
+ CONF_IPV6_STATUS_URL, &error);
+ if (!error)
+ connman_settings.ipv6_status_url = ipv6url;
+
+ g_clear_error(&error);
}
static int config_init(const char *file)
@@ -547,6 +573,16 @@ const char *connman_option_get_string(const char *key)
if (g_str_equal(key, CONF_VENDOR_CLASS_ID))
return connman_settings.vendor_class_id;
+ if (g_str_equal(key, CONF_IPV4_STATUS_URL))
+ return connman_settings.ipv4_status_url ?
+ connman_settings.ipv4_status_url:
+ DEFAULT_IPV4_STATUS_URL;
+
+ if (g_str_equal(key, CONF_IPV6_STATUS_URL))
+ return connman_settings.ipv6_status_url ?
+ connman_settings.ipv6_status_url :
+ DEFAULT_IPV6_STATUS_URL;
+
if (g_strcmp0(key, "wifi") == 0) {
if (!option_wifi)
return "nl80211,wext";
@@ -791,6 +827,8 @@ int main(int argc, char *argv[])
g_free(connman_settings.auto_connect);
g_free(connman_settings.preferred_techs);
+ g_free(connman_settings.ipv4_status_url);
+ g_free(connman_settings.ipv6_status_url);
g_strfreev(connman_settings.fallback_nameservers);
g_strfreev(connman_settings.blacklisted_interfaces);
g_strfreev(connman_settings.tethering_technologies);
diff --git a/src/wispr.c b/src/wispr.c
index 03b38bb..0441b54 100644
--- a/src/wispr.c
+++ b/src/wispr.c
@@ -30,9 +30,6 @@
#include "connman.h"
-#define STATUS_URL_IPV4 "http://ipv4.connman.net/online/status.html"
-#define STATUS_URL_IPV6 "http://ipv6.connman.net/online/status.html"
-
struct connman_wispr_message {
bool has_error;
const char *current_element;
@@ -884,10 +881,12 @@ static int wispr_portal_detect(struct
connman_wispr_portal_context *wp_context)
if (wp_context->type == CONNMAN_IPCONFIG_TYPE_IPV4) {
g_web_set_address_family(wp_context->web, AF_INET);
- wp_context->status_url = STATUS_URL_IPV4;
+ wp_context->status_url =
+ connman_option_get_string("Ipv4StatusUrl");
} else {
g_web_set_address_family(wp_context->web, AF_INET6);
- wp_context->status_url = STATUS_URL_IPV6;
+ wp_context->status_url =
+ connman_option_get_string("Ipv6StatusUrl");
}
for (i = 0; nameservers[i]; i++)
--
1.9.1
------------------------------
Message: 4
Date: Wed, 25 Jan 2017 17:17:25 +0100
From: Marcel Holtmann <[email protected]>
To: Slava Monich <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] conf: Allow to configure status check URLs
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
Hi Slava,
> The keys in main.conf are "Ipv4StatusUrl" and "Ipv6StatusUrl"
> for IPv4 and IPv6, respectively.
> ---
> doc/connman.conf.5.in | 4 ++++
> src/6to4.c | 5 ++---
> src/main.c | 38 ++++++++++++++++++++++++++++++++++++++
> src/wispr.c | 9 ++++-----
> 4 files changed, 48 insertions(+), 8 deletions(-)
>
> diff --git a/doc/connman.conf.5.in b/doc/connman.conf.5.in
> index 9b28aad..481e8f2 100644
> --- a/doc/connman.conf.5.in
> +++ b/doc/connman.conf.5.in
> @@ -136,6 +136,10 @@ See RFC6343. Default value is false (as recommended by
> RFC6343 section 4.1).
> Set DHCP option 60 (Vendor Class ID) to the given string. This option can
> be used by DHCP servers to identify specific clients without having to
> rely on MAC address ranges, etc
> +.BI Ipv4StatusUrl=url
> +IPv4 status check URL. Default is http://ipv4.connman.net/online/status.html
> +.BI Ipv6StatusUrl=url
> +IPv6 status check URL. Default is http://ipv6.connman.net/online/status.html
> .SH "EXAMPLE"
> The following example configuration disables hostname updates and enables
> ethernet tethering.
my original comments about this can be still found on the mailing list. Maybe
worth while reading up on.
However any discussion here without describing what is expected from the URL to
behave is not even worth considering. If you give the user the ability to
change it, then they should clearly know what they are getting into.
Regards
Marcel
------------------------------
Message: 5
Date: Wed, 25 Jan 2017 18:13:10 +0000
From: [email protected]
To: [email protected]
Subject: [PATCH v3 0/8] session: Add per-interface routing
Message-ID: <[email protected]>
From: Lukasz Nowak <[email protected]>
changes from v2:
- implemented source IP rule in firewall-nftables
- using "*" or "" for AllowedInterface allows any interface
changes from v1:
- added documentation
- split firewall and session changes into separate commits
- cosmetic updates after v1 review
Adding a new feature to the sessions, which allows applications to direct
routed traffic to a specific network interface.
This requires that multiple default routes with gateways are set up, one
for each interface. And then iproute and iptables rules need to be added
to direct traffic based on source ip address, to the correct routing table.
Applications can use bind before connect mechanism, to bind sockets to
required interfaces.
The application side can be tested with:
ping -I <interface_ip> <target_ip>
Use case for this is to have multiple network interfaces available for
external traffic at the same time. It can be used to validate that a full
path to an external server is working properly, by maintaining multiple
tcp connections, one for each interface.
Lukasz Nowak (8):
session: Fix default route for ppp services
session: Add AllowedInterface config parameter
client: Add session AllowedInterface config
firewall: Add fwmark based on source ip address
session: Add source ip rule
session: Remove old session rules and routes after a config change
client: Add session source ip rule
doc: Session multi-interface routing
client/commands.c | 39 ++++++++++++
doc/session-api.txt | 23 +++++++
doc/session-overview.txt | 31 +++++++++
include/session.h | 2 +
src/connman.h | 3 +-
src/firewall-iptables.c | 11 +++-
src/firewall-nftables.c | 108 ++++++++++++++++++++++++++-----
src/session.c | 162 ++++++++++++++++++++++++++++++++++++++++++++---
8 files changed, 353 insertions(+), 26 deletions(-)
--
2.7.4
------------------------------
Message: 6
Date: Wed, 25 Jan 2017 18:13:11 +0000
From: [email protected]
To: [email protected]
Subject: [PATCH v3 1/8] session: Fix default route for ppp services
Message-ID: <[email protected]>
From: Lukasz Nowak <[email protected]>
When a session is connected to a ppp service, ipconfig
will not contain a gateway IP address. Currently setting up
of the session routing table fails, due to
__connman_inet_add_default_to_table returning an error.
In that scenario, INADDR_ANY needs to be used as a gateway.
---
src/session.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/session.c b/src/session.c
index b1e9e1b..09fc7c3 100644
--- a/src/session.c
+++ b/src/session.c
@@ -351,6 +351,7 @@ static void add_default_route(struct connman_session
*session)
{
struct connman_ipconfig *ipconfig;
int err;
+ struct in_addr addr = { INADDR_ANY };
if (!session->service)
return;
@@ -359,6 +360,9 @@ static void add_default_route(struct connman_session
*session)
session->index = __connman_ipconfig_get_index(ipconfig);
session->gateway = g_strdup(__connman_ipconfig_get_gateway(ipconfig));
+ if (!session->gateway)
+ session->gateway = g_strdup(inet_ntoa(addr));
+
DBG("index %d routing table %d default gateway %s",
session->index, session->mark, session->gateway);
--
2.7.4
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 15, Issue 29
***************************************