Merge "Added support to set and get prefix length." into tizen submit/tizen/20180918.091131
authorJaehyun Kim <jeik01.kim@samsung.com>
Tue, 18 Sep 2018 07:49:49 +0000 (07:49 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Tue, 18 Sep 2018 07:49:49 +0000 (07:49 +0000)
1  2 
src/wifi-config.c

@@@ -1297,12 -1306,15 +1308,16 @@@ gboolean handle_save_configuration(Wif
        if (conf->ip_info->subnet_mask != NULL) {
                unsigned char prefix_len;
                prefix_len = __netconfig_convert_netmask_to_prefixlen(
 -                                                                conf->ip_info->subnet_mask);
 -              g_key_file_set_integer(keyfile, group_name,
 -                                               WIFI_CONFIG_IPV4_SUBNET_MASK, prefix_len);
 +                              conf->ip_info->subnet_mask);
 +              if (prefix_len > 0 && prefix_len < 32)
 +                      g_key_file_set_integer(keyfile, group_name,
 +                                      WIFI_CONFIG_IPV4_SUBNET_MASK, prefix_len);
        }
  
+       if (conf->ip_info->prefix_length > 0)
+               g_key_file_set_integer(keyfile, group_name,
+                               WIFI_CONFIG_IPV6_PREFIX_LEN, conf->ip_info->prefix_length);
        if (conf->ip_info->gateway_address != NULL)
                g_key_file_set_string(keyfile, group_name,
                        WIFI_CONFIG_IPV4_GATEWAY_ADDRESS, conf->ip_info->gateway_address);