Wireless not connecting

2015-06-18 Thread Thomas Green
Please find attached a partial log file when I'm trying to go from one wireless 
AP to another.  I disconnect from the current wireless AP, then issue a connect 
to the new one.  The disconnect happens correctly, but when I try to connect to 
the new one it appears to associate, but doesn't move further 
(associate->ready->online).  On line 1095 we see wlan0 begin to come up, then 
waiting through a few scans, then finally the state goes from association to 
disconnect.  This is an access point that we have successfully attached to  in 
the past, and if I go from a wired connection to this wireless AP it works 
fine.  Am I missing something here that I need to make the connection work?  
I'm running version 1.29.

Tom


connmand.out.gz
Description: connmand.out.gz
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Re: Disable Firewall support in connman

2015-06-18 Thread Vidhya Govindan
>*From where does this function get called if it manages to prevent
*> ConnMan from running? BTW, does ConnMan close down or what happens?

connmand[4691]: src/ipconfig.c:__connman_ipconfig_init()
connmand[4691]: src/rtnl.c:__connman_rtnl_init()
connmand[4691]: src/task.c:__connman_task_init()
connmand[4691]: src/proxy.c:__connman_proxy_init()
connmand[4691]: src/detect.c:__connman_detect_init()
connmand[4691]: src/rtnl.c:connman_rtnl_register() rtnl 0xa2448 name detect
connmand[4691]: src/session.c:__connman_session_init()
connmand[4691]: src/notifier.c:connman_notifier_register() notifier 0xa2510
name session
connmand[4691]: src/firewall.c:__connman_firewall_enable() mangle INPUT -j
CONNMARK --restore-mark
connmand[4691]: src/firewall.c:insert_managed_rule() table mangle add
managed chain for INPUT
connmand[4691]: src/iptables.c:__connman_iptables_new_chain() -t mangle -N
connman-INPUT
connmand[4691]: src/iptables.c:iptables_init() mangle
connmand[4691]: src/iptables.c:iptables_add_chain() table mangle chain
connman-INPUT
connmand[4691]: src/iptables.c:__connman_iptables_insert() -t mangle -I
INPUT -j connman-INPUT
(null) v(null): Couldn't load target `standard':No such file or directory

-

When I am running connman with -ndr, I see above messages and after
printing Couldn't load target, connmand

exits.

This function
connmand[4691]: src/firewall.c:insert_managed_rule() table mangle add
managed chain for INPUT

is calling __connman_iptables_insert() -t mangle -I INPUT -j connman-INPUT

which is resulting in the Couldn't load target error.

By commenting the lines (which I mentioned in previous posts), we are
able to make

connmand work without any such error messages.

Can you please let us know how to disable calling this firewall
function? (or why

this firewall functions are getting called)

Thanks,


On Thu, Jun 18, 2015 at 5:12 PM, Vidhya Govindan 
wrote:

> Hi
>
> Thanks for your responses.
>
> Please find the logs below which is coming when I run connmand
>
> connmand[4691]: src/ipconfig.c:__connman_ipconfig_init()
> connmand[4691]: src/rtnl.c:__connman_rtnl_init()
> connmand[4691]: src/task.c:__connman_task_init()
> connmand[4691]: src/proxy.c:__connman_proxy_init()
> connmand[4691]: src/detect.c:__connman_detect_init()
> connmand[4691]: src/rtnl.c:connman_rtnl_register() rtnl 0xa2448 name detect
> connmand[4691]: src/session.c:__connman_session_init()
> connmand[4691]: src/notifier.c:connman_notifier_register() notifier
> 0xa2510 name session
> connmand[4691]: src/firewall.c:__connman_firewall_enable() mangle INPUT -j
> CONNMARK --restore-mark
> connmand[4691]: src/firewall.c:insert_managed_rule() table mangle add
> managed chain for INPUT
> connmand[4691]: src/iptables.c:__connman_iptables_new_chain() -t mangle -N
> connman-INPUT
> connmand[4691]: src/iptables.c:iptables_init() mangle
> connmand[4691]: src/iptables.c:iptables_add_chain() table mangle chain
> connman-INPUT
> connmand[4691]: src/iptables.c:__connman_iptables_insert() -t mangle -I
> INPUT -j connman-INPUT
> (null) v(null): Couldn't load target `standard':No such file or directory
>
> ---
> On debugging we found that in function __connman_iptables_insert() -I
> option is expecting target name which is already added to the chain.
> iptables_add_chain() - is adding target name connman-INPUT to chain, but
> while __connman_iptables_insert -I instead of connman-INPUT, -I INPUT is
> given. There fore it results in error could not load target which is not in
> chain.
>
> On debugging further we found that it is called in firewall.c,
> static int insert_managed_chain(const char *table_name, int id)
> {
> char *rule, *managed_chain;
> int err;
>
> managed_chain = g_strdup_printf("%s%s", CHAIN_PREFIX,
> builtin_chains[id]);
>
> DBG("T%s C %s", table_name, managed_chain);
> err = __connman_iptables_new_chain(table_name, managed_chain);
> if (err < 0)
> goto out;
>
> rule = g_strdup_printf("-j %s", managed_chain);
> DBG("T%s C %s R %s ID %d", table_name, builtin_chains[id],
> rule, id);
> //err = __connman_iptables_insert(table_name, builtin_chains[id],
> rule);
> /*  err = __connman_iptables_insert(table_name, managed_chain, rule);
> g_free(rule);
> if (err < 0) {
> __connman_iptables_delete_chain(table_name,
> managed_chain);
> goto out;
> */
>
>
> 
> By commenting the lines shown above, we are able to run connmand without
> any problems.
> As this is seems to be a dirty hack, we want to do it in a clean manner.
>
> Can you please suggest which way we can use?
>
> Thanks,
> Vidhya
>
>
> On Thu, Jun 18, 2015 at 3:24 PM, Vidhya Govindan 
> wrote:
>
>> Hi,
>>
>> Co

heaphone jack

2015-06-18 Thread Thomas Green
Still having issues.  Not currently sure if it is our pipeline or not, I'm 
still trying to figure it out.

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


[PATCH] gsupplicant: Fix potential crash in case memory allocaiton failed

2015-06-18 Thread Maneesh Jain
The patch is used to check if memory is allocated or not properly
in following functions. In case memory is not allocated, return
it from the function to avoid any potential crash.

a. signal_peer_found
b. signal_peer_changed
---
 gsupplicant/supplicant.c |6 ++
 1 file changed, 6 insertions(+)

diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
old mode 100644
new mode 100755
index 1aca79c..c9ed8e2
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -2793,6 +2793,9 @@ static void signal_peer_found(const char *path, 
DBusMessageIter *iter)
g_hash_table_replace(peer_mapping, peer->path, interface);

property_data = dbus_malloc0(sizeof(struct peer_property_data));
+   if (!property_data)
+   return;
+   
property_data->peer = peer;

dbus_message_iter_next(iter);
@@ -2850,6 +2853,9 @@ static void signal_peer_changed(const char *path, 
DBusMessageIter *iter)
}
property_data = dbus_malloc0(sizeof(struct peer_property_data));
+   if (!property_data)
+   return;
+   
property_data->peer = peer;

supplicant_dbus_property_foreach(iter, peer_property, property_data);
--
1.7.9.5

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


[PATCH] gsupplicant: Fix possible memory leak in g_supplicant_set_country()

2015-06-18 Thread Maneesh Jain
In case supplicant_dbus_property_set() function returns error, 'regdom'
memory is not freed.
---
 gsupplicant/supplicant.c |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index fb62a97..38cbad1 100755
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -3273,6 +3273,7 @@ int g_supplicant_set_country(const char *alpha2,
const void *user_data)
 {
struct supplicant_regdom *regdom;
+   int ret;

SUPPLICANT_DBG("Country setting %s", alpha2);

@@ -3287,10 +3288,15 @@ int g_supplicant_set_country(const char *alpha2,
regdom->alpha2 = alpha2;
regdom->user_data = user_data;

-   return supplicant_dbus_property_set(SUPPLICANT_PATH, 
SUPPLICANT_INTERFACE,
+   ret =  supplicant_dbus_property_set(SUPPLICANT_PATH, 
SUPPLICANT_INTERFACE,
"Country", DBUS_TYPE_STRING_AS_STRING,
country_params, country_result,
regdom, NULL);
+   if (ret < 0) {
+   dbus_free(regdom);
+   SUPPLICANT_DBG("Unable to set Country configuration");
+   }
+   return ret;
 }

 int g_supplicant_interface_set_country(GSupplicantInterface *interface,
--
1.7.9.5

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


How to tell to connMan to use only one interface

2015-06-18 Thread Sukanya Ch
Hi,


I have two wlan interfaces. But I want to make use of only one interface.
How can I tell that to connman to use only one interface.

Thanks in Advance.


*Thanks,*

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


[PATCHv4 2/2] client: Add support of MoveAfter Service API

2015-06-18 Thread Saurav Babu
This patch handles MoveAfter() method from Service API in connman client.
This can be used to move any VPN service after any other VPN Service.
For Connman services this won't be much useful as the order is not
remembered after service list sort.
---
 client/commands.c | 61 +++
 1 file changed, 61 insertions(+)

diff --git a/client/commands.c b/client/commands.c
index d867ca3..7cdef93 100644
--- a/client/commands.c
+++ b/client/commands.c
@@ -788,6 +788,64 @@ static int cmd_service_move_before(char *args[], int num,
services->target);
 }
 
+static int move_after_return(DBusMessageIter *iter, const char *error,
+   void *user_data)
+{
+   struct move_service *services = user_data;
+   char *service;
+   char *target;
+
+   if (!error) {
+   service = strrchr(services->service, '/');
+   service++;
+   target = strrchr(services->target, '/');
+   target++;
+   fprintf(stdout, "Moved %s after %s\n", service, target);
+   } else
+   fprintf(stderr, "Error %s: %s\n", services->service, error);
+
+   g_free(services->service);
+   g_free(services->target);
+   g_free(user_data);
+
+   return 0;
+}
+
+static void move_after_append_args(DBusMessageIter *iter, void *user_data)
+{
+   char *path = user_data;
+
+   dbus_message_iter_append_basic(iter,
+   DBUS_TYPE_OBJECT_PATH, &path);
+
+   return;
+}
+
+static int cmd_service_move_after(char *args[], int num,
+   struct connman_option *options)
+{
+   const char *iface = "net.connman.Service";
+   struct move_service *services = g_new(struct move_service, 1);
+
+   if (num > 3)
+   return -E2BIG;
+
+   if (num < 3)
+   return -EINVAL;
+
+   if (check_dbus_name(args[1]) == false)
+   return -EINVAL;
+
+   services->service = g_strdup_printf("/net/connman/service/%s", args[1]);
+   services->target = g_strdup_printf("/net/connman/service/%s", args[2]);
+
+   return __connmanctl_dbus_method_call(connection, CONNMAN_SERVICE,
+   services->service, iface, "MoveAfter",
+   move_after_return, services,
+   move_after_append_args,
+   services->target);
+}
+
 static int config_return(DBusMessageIter *iter, const char *error,
void *user_data)
 {
@@ -2464,6 +2522,9 @@ static const struct {
{ "move-before",   "   ", NULL,
  cmd_service_move_before, "Move  before ",
  lookup_service_arg },
+   { "move-after",   "", NULL,
+ cmd_service_move_after, "Move  after ",
+ lookup_service_arg },
{ "config",   "",config_options,  cmd_config,
  "Set service configuration options", lookup_config },
{ "monitor",  "[off]",monitor_options, cmd_monitor,
-- 
1.9.1

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


[PATCHv4 1/2] client: Add support of MoveBefore Service API

2015-06-18 Thread Saurav Babu
This patch handles MoveBefore() method from Service API in connman client.
This can be used to move any VPN service before any other VPN Service. For
Connman services this won't be much useful as the order is not remembered
after service list sort.
---
 client/commands.c | 66 +++
 1 file changed, 66 insertions(+)

diff --git a/client/commands.c b/client/commands.c
index 9208016..d867ca3 100644
--- a/client/commands.c
+++ b/client/commands.c
@@ -725,6 +725,69 @@ static int cmd_disconnect(char *args[], int num, struct 
connman_option *options)
disconnect_return, path, NULL, NULL);
 }
 
+struct move_service {
+   char *service;
+   char *target;
+};
+
+static int move_before_return(DBusMessageIter *iter, const char *error,
+   void *user_data)
+{
+   struct move_service *services = user_data;
+   char *service;
+   char *target;
+
+   if (!error) {
+   service = strrchr(services->service, '/');
+   service++;
+   target = strrchr(services->target, '/');
+   target++;
+   fprintf(stdout, "Moved %s before %s\n", service, target);
+   } else
+   fprintf(stderr, "Error %s: %s\n", services->service, error);
+
+   g_free(services->service);
+   g_free(services->target);
+   g_free(user_data);
+
+   return 0;
+}
+
+static void move_before_append_args(DBusMessageIter *iter, void *user_data)
+{
+   char *path = user_data;
+
+   dbus_message_iter_append_basic(iter,
+   DBUS_TYPE_OBJECT_PATH, &path);
+
+   return;
+}
+
+static int cmd_service_move_before(char *args[], int num,
+   struct connman_option *options)
+{
+   const char *iface = "net.connman.Service";
+   struct move_service *services = g_new(struct move_service, 1);
+
+   if (num > 3)
+   return -E2BIG;
+
+   if (num < 3)
+   return -EINVAL;
+
+   if (check_dbus_name(args[1]) == false)
+   return -EINVAL;
+
+   services->service = g_strdup_printf("/net/connman/service/%s", args[1]);
+   services->target = g_strdup_printf("/net/connman/service/%s", args[2]);
+
+   return __connmanctl_dbus_method_call(connection, CONNMAN_SERVICE,
+   services->service, iface, "MoveBefore",
+   move_before_return, services,
+   move_before_append_args,
+   services->target);
+}
+
 static int config_return(DBusMessageIter *iter, const char *error,
void *user_data)
 {
@@ -2398,6 +2461,9 @@ static const struct {
  "Connect a given service or peer", lookup_service_arg },
{ "disconnect",   "", NULL,  cmd_disconnect,
  "Disconnect a given service or peer", lookup_service_arg },
+   { "move-before",   "   ", NULL,
+ cmd_service_move_before, "Move  before ",
+ lookup_service_arg },
{ "config",   "",config_options,  cmd_config,
  "Set service configuration options", lookup_config },
{ "monitor",  "[off]",monitor_options, cmd_monitor,
-- 
1.9.1

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


Re: [PATCH] supplicant: Fix Possible Memory Leak

2015-06-18 Thread Patrik Flykt
On Thu, 2015-06-18 at 10:03 +0530, Maneesh Jain wrote:
> In case "supplicant_dbus_property_set()" function return fail,
> "regdom" memeory block does not free.

After applying your previous patch, this no longer applies. Please
rebase and resend.

Patrik

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


[PATCHv4 0/2] client: Add support of MoveBefore/MoveAfter method from Service API

2015-06-18 Thread Saurav Babu
Fixed help text to remove ambiguity
Saurav Babu (2):
  client: Add support of MoveBefore Service API
  client: Add support of MoveAfter Service API

 client/commands.c | 127 ++
 1 file changed, 127 insertions(+)

-- 
1.9.1

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


Re: [PATCH] supplican:Fix Possible Memory Leak

2015-06-18 Thread Patrik Flykt
On Thu, 2015-06-18 at 10:02 +0530, Maneesh Jain wrote:
> In case "supplicant_dbus_property_set()" function return fail,
> "regdom" memeory block does not free.
> 
> Signed-off-by: Maneesh Jain 

Applied. We don't do signed-off-bys in this project so you can leave
that one off the next time.

Cheers,

Patrik

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


Re: Disable Firewall support in connman

2015-06-18 Thread Patrik Flykt

Hi,

On Thu, 2015-06-18 at 17:12 +0530, Vidhya Govindan wrote:
> static int insert_managed_chain(const char *table_name, int id)
> {
> char *rule, *managed_chain;
> int err;
> 
> managed_chain = g_strdup_printf("%s%s", CHAIN_PREFIX,
> builtin_chains[id]);
> 
> DBG("T%s C %s", table_name, managed_chain);
> err = __connman_iptables_new_chain(table_name, managed_chain);
> if (err < 0)
> goto out;
> 
> rule = g_strdup_printf("-j %s", managed_chain);
> DBG("T%s C %s R %s ID %d", table_name, builtin_chains[id],
> rule, id);
> //err = __connman_iptables_insert(table_name, builtin_chains[id],
> rule);
> /*  err = __connman_iptables_insert(table_name, managed_chain, rule);
> g_free(rule);
> if (err < 0) {
> __connman_iptables_delete_chain(table_name, managed_chain);
> goto out;
> */
> 
> 
> By commenting the lines shown above, we are able to run connmand without
> any problems.
> As this is seems to be a dirty hack, we want to do it in a clean manner.
> 
> Can you please suggest which way we can use?

>From where does this function get called if it manages to prevent
ConnMan from running? BTW, does ConnMan close down or what happens?

Cheers,

Patrik

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


Re: [PATCH] connman.service: Remove extra dependency on dbus.socket

2015-06-18 Thread Patrik Flykt
On Fri, 2015-06-12 at 15:58 +0300, Patrik Flykt wrote:
> Systemd services with Type=dbus automatically have a dependency on
> dbus.socket. This fix was noticed in Debian's ConnMan package.

Applied.

Patrik

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


Re: [PATCH] gsupplicant: Remove unused net_mapping hash table

2015-06-18 Thread Patrik Flykt
On Wed, 2015-06-17 at 14:22 +0530, Harish Jenny K N wrote:
> Removed all occurrences of net_mapping hash table as there
> were no entries getting added.

Applied, thanks!

Patrik

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


Re: Disable Firewall support in connman

2015-06-18 Thread Vidhya Govindan
Hi

Thanks for your responses.

Please find the logs below which is coming when I run connmand

connmand[4691]: src/ipconfig.c:__connman_ipconfig_init()
connmand[4691]: src/rtnl.c:__connman_rtnl_init()
connmand[4691]: src/task.c:__connman_task_init()
connmand[4691]: src/proxy.c:__connman_proxy_init()
connmand[4691]: src/detect.c:__connman_detect_init()
connmand[4691]: src/rtnl.c:connman_rtnl_register() rtnl 0xa2448 name detect
connmand[4691]: src/session.c:__connman_session_init()
connmand[4691]: src/notifier.c:connman_notifier_register() notifier 0xa2510
name session
connmand[4691]: src/firewall.c:__connman_firewall_enable() mangle INPUT -j
CONNMARK --restore-mark
connmand[4691]: src/firewall.c:insert_managed_rule() table mangle add
managed chain for INPUT
connmand[4691]: src/iptables.c:__connman_iptables_new_chain() -t mangle -N
connman-INPUT
connmand[4691]: src/iptables.c:iptables_init() mangle
connmand[4691]: src/iptables.c:iptables_add_chain() table mangle chain
connman-INPUT
connmand[4691]: src/iptables.c:__connman_iptables_insert() -t mangle -I
INPUT -j connman-INPUT
(null) v(null): Couldn't load target `standard':No such file or directory

---
On debugging we found that in function __connman_iptables_insert() -I
option is expecting target name which is already added to the chain.
iptables_add_chain() - is adding target name connman-INPUT to chain, but
while __connman_iptables_insert -I instead of connman-INPUT, -I INPUT is
given. There fore it results in error could not load target which is not in
chain.

On debugging further we found that it is called in firewall.c,
static int insert_managed_chain(const char *table_name, int id)
{
char *rule, *managed_chain;
int err;

managed_chain = g_strdup_printf("%s%s", CHAIN_PREFIX,
builtin_chains[id]);

DBG("T%s C %s", table_name, managed_chain);
err = __connman_iptables_new_chain(table_name, managed_chain);
if (err < 0)
goto out;

rule = g_strdup_printf("-j %s", managed_chain);
DBG("T%s C %s R %s ID %d", table_name, builtin_chains[id],
rule, id);
//err = __connman_iptables_insert(table_name, builtin_chains[id],
rule);
/*  err = __connman_iptables_insert(table_name, managed_chain, rule);
g_free(rule);
if (err < 0) {
__connman_iptables_delete_chain(table_name, managed_chain);
goto out;
*/


By commenting the lines shown above, we are able to run connmand without
any problems.
As this is seems to be a dirty hack, we want to do it in a clean manner.

Can you please suggest which way we can use?

Thanks,
Vidhya


On Thu, Jun 18, 2015 at 3:24 PM, Vidhya Govindan 
wrote:

> Hi,
>
> Could you please let us know how we can disable firewall support in
> connman.
> There are some problems I am facing when I am running firewall. So want to
> test by disabling it.
>
> Thanks in advance.
>
> Vidhya
>
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: proxy configuration

2015-06-18 Thread Patrik Flykt
On Fri, 2015-06-12 at 16:36 +0200, ronney.kai...@europe.svpworldwide.com
wrote:
> One last (I hope...:o) questionthe format of the server URI provided 
> when using the "manual" method is (according to the documentation) 
> "server.example.com:911", but what about the format of the URL when used 
> together with the "auto" mode? Shall the protocol be provided, like "
> http://www.example.com";, or should it only be "www.example.com"? 

If it still is relevant: the code checks for http and https in front,
and adds http if just the host/domain name is given. If I read the code
in gweb/gweb.c, parse_url() correctly.


Cheers,

Patrik

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


Re: [PATCHv3 1/2] client: Add support of MoveBefore Service API

2015-06-18 Thread Patrik Flykt
On Mon, 2015-06-15 at 16:03 +0530, Saurav Babu wrote:
> This patch handles MoveBefore() method from Service API in connman client.
> This can be used to move any VPN service before any other VPN Service. For
> Connman services this won't be much useful as the order is not remembered
> after service list sort.
> ---
>  client/commands.c | 66 
> +++
>  1 file changed, 66 insertions(+)
> 
> diff --git a/client/commands.c b/client/commands.c
> index 9208016..74b287b 100644
> --- a/client/commands.c
> +++ b/client/commands.c
> @@ -725,6 +725,69 @@ static int cmd_disconnect(char *args[], int num, struct 
> connman_option *options)
>   disconnect_return, path, NULL, NULL);
>  }
>  
> +struct move_service {
> + char *service;
> + char *target;
> +};
> +
> +static int move_before_return(DBusMessageIter *iter, const char *error,
> + void *user_data)
> +{
> + struct move_service *services = user_data;
> + char *service;
> + char *target;
> +
> + if (!error) {
> + service = strrchr(services->service, '/');
> + service++;
> + target = strrchr(services->target, '/');
> + target++;
> + fprintf(stdout, "Moved %s before %s\n", service, target);
> + } else
> + fprintf(stderr, "Error %s: %s\n", services->service, error);
> +
> + g_free(services->service);
> + g_free(services->target);
> + g_free(user_data);
> +
> + return 0;
> +}
> +
> +static void move_before_append_args(DBusMessageIter *iter, void *user_data)
> +{
> + char *path = user_data;
> +
> + dbus_message_iter_append_basic(iter,
> + DBUS_TYPE_OBJECT_PATH, &path);
> +
> + return;
> +}
> +
> +static int cmd_service_move_before(char *args[], int num,
> + struct connman_option *options)
> +{
> + const char *iface = "net.connman.Service";
> + struct move_service *services = g_new(struct move_service, 1);
> +
> + if (num > 3)
> + return -E2BIG;
> +
> + if (num < 3)
> + return -EINVAL;
> +
> + if (check_dbus_name(args[1]) == false)
> + return -EINVAL;
> +
> + services->service = g_strdup_printf("/net/connman/service/%s", args[1]);
> + services->target = g_strdup_printf("/net/connman/service/%s", args[2]);
> +
> + return __connmanctl_dbus_method_call(connection, CONNMAN_SERVICE,
> + services->service, iface, "MoveBefore",
> + move_before_return, services,
> + move_before_append_args,
> + services->target);
> +}
> +
>  static int config_return(DBusMessageIter *iter, const char *error,
>   void *user_data)
>  {
> @@ -2398,6 +2461,9 @@ static const struct {
> "Connect a given service or peer", lookup_service_arg },
>   { "disconnect",   "", NULL,  cmd_disconnect,
> "Disconnect a given service or peer", lookup_service_arg },
> + { "move-before",   "   ", NULL,
> +   cmd_service_move_before, "Move a service before another service",
> +   lookup_service_arg },

As I already commented on patch v1, with the above description it is
impossible to know whether  is moved before  or
the opposite. Please fix the help text in a way that it is unambiguous
which one move before which one. Same for move-after. ATM I have to look
a the code to figure out which one is which.

>   { "config",   "",config_options,  cmd_config,
> "Set service configuration options", lookup_config },
>   { "monitor",  "[off]",monitor_options, cmd_monitor,

Cheers,

Patrik


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


Re: Disable Firewall support in connman

2015-06-18 Thread Tomasz Bursztyka

Hi,

Could you please let us know how we can disable firewall support in connman.


There is no firewall in ConnMan. ConnMan might use iptables to setup 
nating (when tethering)
and some other accounting stuff. But besides that, it does not use 
iptables for firewalling.


What is the issue you are facing?

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


Re: Disable Firewall support in connman

2015-06-18 Thread Patrik Flykt
On Thu, 2015-06-18 at 15:24 +0530, Vidhya Govindan wrote:
> Hi,
> 
> Could you please let us know how we can disable firewall support in connman.

There are no iptables features in use in ConnMan unless you use Session
support which I'm fairly sure you're not using.

> There are some problems I am facing when I am running firewall. So want to
> test by disabling it.

What are you doing, exactly?

Cheers,

Patrik

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


Disable Firewall support in connman

2015-06-18 Thread Vidhya Govindan
Hi,

Could you please let us know how we can disable firewall support in connman.
There are some problems I am facing when I am running firewall. So want to
test by disabling it.

Thanks in advance.

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


Re: Connman without iptables

2015-06-18 Thread Daniel Wagner
On 06/18/2015 10:35 AM, Patrik Flykt wrote:
> On Thu, 2015-06-18 at 13:48 +0530, Sukanya Ch wrote:
>> With these changes I am not able to run connman daemon..Here I am
>> providing
>> the logs.
>>
>> connmand[4691]: src/ipconfig.c:__connman_ipconfig_init()
>> connmand[4691]: src/rtnl.c:__connman_rtnl_init()
>> connmand[4691]: src/task.c:__connman_task_init()
>> connmand[4691]: src/proxy.c:__connman_proxy_init()
>> connmand[4691]: src/detect.c:__connman_detect_init()
>> connmand[4691]: src/rtnl.c:connman_rtnl_register() rtnl 0xa2448 name
>> detect
>> connmand[4691]: src/session.c:__connman_session_init()
>> connmand[4691]: src/notifier.c:connman_notifier_register() notifier
>> 0xa2510
>> name session
>> connmand[4691]: src/firewall.c:__connman_firewall_enable() mangle
>> INPUT -j
>> CONNMARK --restore-mark
>> connmand[4691]: src/firewall.c:insert_managed_rule() table mangle add
>> managed chain for INPUT
>> connmand[4691]: src/iptables.c:__connman_iptables_new_chain() -t
>> mangle -N
>> connman-INPUT
>> connmand[4691]: src/iptables.c:iptables_init() mangle
>> connmand[4691]: src/iptables.c:iptables_add_chain() table mangle chain
>> connman-INPUT
>> connmand[4691]: src/iptables.c:__connman_iptables_insert() -t mangle
>> -I
>> INPUT -j connman-INPUT
>> (null) v(null): Couldn't load target `standard':No such file or
>> directory
> 
> The above lines state only that connman logs errors, not that ConnMan is
> unable to run. __connman_iptables_init() and __connman_firewall_init()
> always return success, so if ConnMan stops running it happens later in
> some other part of the code which is not visible above.

Something I had on my TODO list was to dynamically detect if iptables is
available or not. Google indicates testing for /proc/net/ip_tables*
should do the trick.
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: Connman without iptables

2015-06-18 Thread Patrik Flykt
On Thu, 2015-06-18 at 13:48 +0530, Sukanya Ch wrote:
> With these changes I am not able to run connman daemon..Here I am
> providing
> the logs.
> 
> connmand[4691]: src/ipconfig.c:__connman_ipconfig_init()
> connmand[4691]: src/rtnl.c:__connman_rtnl_init()
> connmand[4691]: src/task.c:__connman_task_init()
> connmand[4691]: src/proxy.c:__connman_proxy_init()
> connmand[4691]: src/detect.c:__connman_detect_init()
> connmand[4691]: src/rtnl.c:connman_rtnl_register() rtnl 0xa2448 name
> detect
> connmand[4691]: src/session.c:__connman_session_init()
> connmand[4691]: src/notifier.c:connman_notifier_register() notifier
> 0xa2510
> name session
> connmand[4691]: src/firewall.c:__connman_firewall_enable() mangle
> INPUT -j
> CONNMARK --restore-mark
> connmand[4691]: src/firewall.c:insert_managed_rule() table mangle add
> managed chain for INPUT
> connmand[4691]: src/iptables.c:__connman_iptables_new_chain() -t
> mangle -N
> connman-INPUT
> connmand[4691]: src/iptables.c:iptables_init() mangle
> connmand[4691]: src/iptables.c:iptables_add_chain() table mangle chain
> connman-INPUT
> connmand[4691]: src/iptables.c:__connman_iptables_insert() -t mangle
> -I
> INPUT -j connman-INPUT
> (null) v(null): Couldn't load target `standard':No such file or
> directory

The above lines state only that connman logs errors, not that ConnMan is
unable to run. __connman_iptables_init() and __connman_firewall_init()
always return success, so if ConnMan stops running it happens later in
some other part of the code which is not visible above.

Cheers,

Patrik

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


[RFC v2] wifi: Try to enable tethering for an unused device

2015-06-18 Thread Patrik Flykt
When enabling tethering, try to first find a device without a network
connection that supports AP mode. If none is found, try again but this
time ignoring the network connection.

Factor out tethering enabling adding a boolea parameter that tells
whether to consider a connected network or not.

Reported by citylight2.
---
v2: Add more temporary debug messages to see what is happening

plugins/wifi.c | 78 +-
 1 file changed, 55 insertions(+), 23 deletions(-)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index 587dee2..0588a9f 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -3062,9 +3062,9 @@ static void sta_remove_callback(int result,
info);
 }
 
-static int tech_set_tethering(struct connman_technology *technology,
-   const char *identifier, const char *passphrase,
-   const char *bridge, bool enabled)
+static int enable_wifi_tethering(struct connman_technology *technology,
+   const char *bridge, const char *identifier,
+   const char *passphrase, bool available)
 {
GList *list;
GSupplicantInterface *interface;
@@ -3074,29 +3074,12 @@ static int tech_set_tethering(struct connman_technology 
*technology,
unsigned int mode;
int err;
 
-   DBG("");
-
-   if (!enabled) {
-   for (list = iface_list; list; list = list->next) {
-   wifi = list->data;
-
-   if (wifi->tethering) {
-   wifi->tethering = false;
-
-   connman_inet_remove_from_bridge(wifi->index,
-   bridge);
-   wifi->bridged = false;
-   }
-   }
-
-   connman_technology_tethering_notify(technology, false);
-
-   return 0;
-   }
-
for (list = iface_list; list; list = list->next) {
wifi = list->data;
 
+   DBG("wifi %p available %d network %p pending_network %p",
+   wifi, available, wifi->network, wifi->pending_network);
+
interface = wifi->interface;
 
if (!interface)
@@ -3114,6 +3097,9 @@ static int tech_set_tethering(struct connman_technology 
*technology,
continue;
}
 
+   if (wifi->network && available)
+   continue;
+
info = g_try_malloc0(sizeof(struct wifi_tethering_info));
if (!info)
return -ENOMEM;
@@ -3160,6 +3146,9 @@ static int tech_set_tethering(struct connman_technology 
*technology,
err = g_supplicant_interface_remove(interface,
sta_remove_callback,
info);
+
+   DBG("tethering wifi %p ifname %s err %d", wifi, ifname, err);
+
if (err == 0)
return err;
}
@@ -3167,6 +3156,49 @@ static int tech_set_tethering(struct connman_technology 
*technology,
return -EOPNOTSUPP;
 }
 
+static int tech_set_tethering(struct connman_technology *technology,
+   const char *identifier, const char *passphrase,
+   const char *bridge, bool enabled)
+{
+   GList *list;
+   struct wifi_data *wifi;
+   int err;
+
+   DBG("");
+
+   if (!enabled) {
+   for (list = iface_list; list; list = list->next) {
+   wifi = list->data;
+
+   if (wifi->tethering) {
+   wifi->tethering = false;
+
+   connman_inet_remove_from_bridge(wifi->index,
+   bridge);
+   wifi->bridged = false;
+   }
+   }
+
+   connman_technology_tethering_notify(technology, false);
+
+   return 0;
+   }
+
+   err = enable_wifi_tethering(technology, bridge, identifier, passphrase,
+   true);
+
+   DBG("enabled tethering for connected interfaces %d", err);
+
+   if (err < 0) {
+   err = enable_wifi_tethering(technology, bridge, identifier,
+   passphrase, false);
+
+   DBG("enabled tethering for all interfaces %d", err);
+   }
+
+   return err;
+}
+
 static void regdom_callback(int result, const char *alpha2, void *user_data)
 {
DBG("");
-- 
2.1.4

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


Connman without iptables

2015-06-18 Thread Sukanya Ch
Hi,

I am using connMan-1.29 version. Here I don't want tethering support so I
disabled CONFIG_BRIDGE
CONFIG_IP_NF_TARGET_MASQUERADE
CONFIG_USB_GADGET
CONFIG_USB_ETH

I came across this line  *("IP-Tables library (for tethering support) ")*
when I am reading README file in connman source code.So I disabled belolw
configurations also.
CONFIG_IP_NF_IPTABLES
CONFIG_IP_MULTIPLE_TABLES
CONFIG_NETFILTER_NETLINK_ACCT
CONFIG_NETFILTER_XT_MATCH_NFACCT
CONFIG_NETFILTER_XT_CONNMARK
CONFIG_NETFILTER_XT_TARGET_CONNMARK
CONFIG_NETFILTER_XT_MATCH_CONNMARK

With these changes I am not able to run connman daemon..Here I am providing
the logs.

connmand[4691]: src/ipconfig.c:__connman_ipconfig_init()
connmand[4691]: src/rtnl.c:__connman_rtnl_init()
connmand[4691]: src/task.c:__connman_task_init()
connmand[4691]: src/proxy.c:__connman_proxy_init()
connmand[4691]: src/detect.c:__connman_detect_init()
connmand[4691]: src/rtnl.c:connman_rtnl_register() rtnl 0xa2448 name detect
connmand[4691]: src/session.c:__connman_session_init()
connmand[4691]: src/notifier.c:connman_notifier_register() notifier 0xa2510
name session
connmand[4691]: src/firewall.c:__connman_firewall_enable() mangle INPUT -j
CONNMARK --restore-mark
connmand[4691]: src/firewall.c:insert_managed_rule() table mangle add
managed chain for INPUT
connmand[4691]: src/iptables.c:__connman_iptables_new_chain() -t mangle -N
connman-INPUT
connmand[4691]: src/iptables.c:iptables_init() mangle
connmand[4691]: src/iptables.c:iptables_add_chain() table mangle chain
connman-INPUT
connmand[4691]: src/iptables.c:__connman_iptables_insert() -t mangle -I
INPUT -j connman-INPUT
(null) v(null): Couldn't load target `standard':No such file or directory


 So can any one please help me in disabling iptables. Is there any other
way to disable ??? in source code??? or is any kernel changes are
required??
Is connman will work without iptables support???
How to make it work without iptables support?? is it is possible?
Can any one please clarify may doubts?



*Thanks,*

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


Re: Issues in connecting wireless network

2015-06-18 Thread Patrik Flykt

Hi,

On Thu, 2015-06-18 at 09:47 +0530, Sriram Sagar wrote:

> I am wondering that, I did not find any kind of .config file inside the
> /var/lib/connman/*

Of course there are no .config files, if you did not create any
yourself.

> |-- ethernet_e0db55c7f732_cable
> |   |-- data
> |   `-- settings
> |-- settings
> |-- wifi_342387df48d1_3131303332303135_managed_none
> |   `-- data
> |-- wifi_342387df48d1_564944454f5f4753324b2d313636656332_managed_none
> |   `-- data
> |-- wifi_342387df48d1_646c696e6b_managed_none
> |   |-- data
> |   `-- settings

Do not touch any of those files. They are connman internal ones, and
making an editing mistake can render the service useless.

> Could you please tell me, anything we need to enable to get the .config
> file in side the directory.
> 
> Am i missing something?

Please read the documentation in doc/ first. Especially
doc/config-format.txt. A service can be provisioned via a .config file,
but notice that no attributes can be changed for it afterwards (as all
information is in the provisioning file and known to be accurate).

The "normal" way to configure a service, though, is to connect to it and
supply any information ConnMan is asking via the Agent interface. These
"user-created" services can have all their attributes updated (via
connmanctl for example) as needed.

HTH,

Patrik


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