Hi Mohamed,

> VPN need to add the VPN host to active network gateway then add
> default gateway as VPN network.

I am not a big fan of this, but right now, I have no better idea on how
to do this properly. However ...

> +static int add_vpn_host(struct connman_element *element,
> +                     const char *gateway,
> +                     const char *host)

Put the second one on the same line.

> +     err = ioctl(sk, SIOCADDRT, &rt);
> +     if (err < 0)
> +             connman_error("Setting default route1 failed (%s)",
> +                         
> +     close(sk);
> +
> +     return err;
> +}
> +
> +

Seriously, you have to stop this two empty lines stuff. I only mention
it once in this review.


> +     if (data->vpn_ip != NULL)
> +             g_free(data->vpn_ip);
>       g_free(data);

That is pointless. g_free() includes a NULL check and so does free().

Regards

Marcel


_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to