Hi Daniel,

On Thu, Oct 21, 2010 at 04:35:34PM -0400, Daniel Wagner wrote:
> From: Daniel Wagner <[email protected]>
After testing it (It doesnt work), I have some further comments:

> +static int vpn_connect(struct connman_provider *provider)
[...]
> +     if (connman_task_set_notify(data->task, "notify",
> +                                     vpn_notify, provider)) {
> +             ret = -ENOMEM;
> +             kill_tun(data->if_name);
> +             connman_task_destroy(data->task);
> +             data->task = NULL;
> +             goto exist_err;
> +     }
> +
> +     ret = vpn_driver_data->vpn_driver->connect(provider, data->task,
> +                                                     &fd, data->if_name);
> +     if (ret < 0)
If that fails, you need to:

             kill_tun(data->if_name);
             connman_task_destroy(data->task);
             data->task = NULL;


> +             goto exist_err;
> +
> +     ret = connman_task_run(data->task, vpn_died, provider,
> +                            &fd, NULL, NULL);
connman_task_run needs to be part of the vpn_driver connect hook. The
openconnect plugin is passing the VPN cookie through stdin, and you need to
call connman_task_run() before writing to stdin, otherwise the stdin file
descriptor is invalid. Failing to give the openconnect binary the cookie leads
to the VPN connection failure.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to