On Tue, 2014-12-16 at 14:31 +0200, [email protected] wrote:
> From: Pasi Sjöholm <[email protected]>
With 'invalid configuration' you mean that the 'Address' property was
not found?
> ---
> plugins/ofono.c | 25 ++++++++++++++-----------
> 1 file changed, 14 insertions(+), 11 deletions(-)
>
> diff --git a/plugins/ofono.c b/plugins/ofono.c
> index 29dfe90..db162a9 100644
> --- a/plugins/ofono.c
> +++ b/plugins/ofono.c
> @@ -826,20 +826,23 @@ static void extract_ipv4_settings(DBusMessageIter
> *array,
>
> context->index = index;
>
> - if (context->ipv4_method != CONNMAN_IPCONFIG_METHOD_FIXED)
> - goto out;
> + if (address) {
How about writing this as 'if (!address)' goto out; instead? Or can
partial IPv4/IPv6 settings be extracted so that it is ok to only update
for example nameservers? Currently this part of the code frees the
current context address and sets it to NULL at the top of this file.
> - context->ipv4_address =
> connman_ipaddress_alloc(CONNMAN_IPCONFIG_TYPE_IPV4);
> - if (!context->ipv4_address) {
> - context->index = -1;
> - goto out;
> - }
> + if (context->ipv4_method != CONNMAN_IPCONFIG_METHOD_FIXED)
> + goto out;
>
> - connman_ipaddress_set_ipv4(context->ipv4_address, address,
> - netmask, gateway);
> + context->ipv4_address =
> connman_ipaddress_alloc(CONNMAN_IPCONFIG_TYPE_IPV4);
> + if (!context->ipv4_address) {
> + context->index = -1;
> + goto out;
> + }
>
> - g_free(context->ipv4_nameservers);
> - context->ipv4_nameservers = nameservers;
> + connman_ipaddress_set_ipv4(context->ipv4_address, address,
> + netmask, gateway);
> +
> + g_free(context->ipv4_nameservers);
> + context->ipv4_nameservers = nameservers;
> + }
>
> out:
> if (context->ipv4_nameservers != nameservers)
Cheers,
Patrik
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman