From: Julien Massot Date: Fri, 15 Jun 2012 13:15:31 +0000 (+0000) Subject: ipconfig: Save prefixlen only if not cleared X-Git-Tag: 1.2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a802b6f66cd572d532cc4d1f3e589beee58ed0e7;p=platform%2Fupstream%2Fconnman.git ipconfig: Save prefixlen only if not cleared This commit fixes a bug when using manual ipv4 addressing. The first time it works, but once the service is reconnected it uses an invalid netmask: 255.255.255.255. --- diff --git a/src/ipconfig.c b/src/ipconfig.c index b401c23..5e34ac0 100644 --- a/src/ipconfig.c +++ b/src/ipconfig.c @@ -2344,8 +2344,9 @@ int __connman_ipconfig_save(struct connman_ipconfig *ipconfig, } key = g_strdup_printf("%snetmask_prefixlen", prefix); - g_key_file_set_integer(keyfile, identifier, - key, ipconfig->address->prefixlen); + if (ipconfig->address->prefixlen != 0) + g_key_file_set_integer(keyfile, identifier, + key, ipconfig->address->prefixlen); g_free(key); key = g_strdup_printf("%slocal_address", prefix);