From a802b6f66cd572d532cc4d1f3e589beee58ed0e7 Mon Sep 17 00:00:00 2001 From: Julien Massot Date: Fri, 15 Jun 2012 13:15:31 +0000 Subject: [PATCH] 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. --- src/ipconfig.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); -- 2.7.4