while (g_variant_iter_loop(sub_iter, "{sv}", &sub_key, &variant)) {
if (g_strcmp0(sub_key, "Address") == 0) {
value = g_variant_get_string(variant, NULL);
while (g_variant_iter_loop(sub_iter, "{sv}", &sub_key, &variant)) {
if (g_strcmp0(sub_key, "Address") == 0) {
value = g_variant_get_string(variant, NULL);
netconfig_dbus_emit_signal(NULL, NETCONFIG_NETWORK_PATH,
NETCONFIG_NETWORK_INTERFACE, "NetworkConfigChanged",
netconfig_dbus_emit_signal(NULL, NETCONFIG_NETWORK_PATH,
NETCONFIG_NETWORK_INTERFACE, "NetworkConfigChanged",
while (g_variant_iter_loop(next, "{sv}", &key1, &variant)) {
if (g_strcmp0(key1, "Interface") == 0) {
value = g_variant_get_string(variant, NULL);
while (g_variant_iter_loop(next, "{sv}", &key1, &variant)) {
if (g_strcmp0(key1, "Interface") == 0) {
value = g_variant_get_string(variant, NULL);
gchar *const args[] = { "/sbin/route", "add", "-net", ip_addr, gw_str,
"netmask", netmask, "dev", interface, NULL };
gchar *const envs[] = { NULL };
gchar *const args[] = { "/sbin/route", "add", "-net", ip_addr, gw_str,
"netmask", netmask, "dev", interface, NULL };
gchar *const envs[] = { NULL };
DBG("ip_addr(%s), netmask(%s), interface(%s), gateway(%s)", ip_addr, netmask, interface, gateway);
DBG("ip_addr(%s), netmask(%s), interface(%s), gateway(%s)", ip_addr, netmask, interface, gateway);
if (ip_addr == NULL || netmask == NULL || interface == NULL) {
ERR("Invalid parameter");
netconfig_error_invalid_parameter(context);
if (ip_addr == NULL || netmask == NULL || interface == NULL) {
ERR("Invalid parameter");
netconfig_error_invalid_parameter(context);
}
if (netconfig_execute_file(path, args, envs) < 0) {
DBG("Failed to add a new route");
netconfig_error_permission_denied(context);
}
if (netconfig_execute_file(path, args, envs) < 0) {
DBG("Failed to add a new route");
netconfig_error_permission_denied(context);
if (ip_addr == NULL || interface == NULL || gateway == NULL) {
ERR("Invalid parameter");
netconfig_error_invalid_parameter(context);
if (ip_addr == NULL || interface == NULL || gateway == NULL) {
ERR("Invalid parameter");
netconfig_error_invalid_parameter(context);
gchar *const args[] = { "/sbin/route", "del", "-net", ip_addr, gw_str,
"netmask", netmask, "dev", interface, NULL };
char *const envs[] = { NULL };
gchar *const args[] = { "/sbin/route", "del", "-net", ip_addr, gw_str,
"netmask", netmask, "dev", interface, NULL };
char *const envs[] = { NULL };
DBG("ip_addr(%s), netmask(%s), interface(%s), gateway(%s)", ip_addr, netmask, interface, gateway);
DBG("ip_addr(%s), netmask(%s), interface(%s), gateway(%s)", ip_addr, netmask, interface, gateway);
if (ip_addr == NULL || netmask == NULL || interface == NULL) {
DBG("Invalid parameter!");
netconfig_error_invalid_parameter(context);
if (ip_addr == NULL || netmask == NULL || interface == NULL) {
DBG("Invalid parameter!");
netconfig_error_invalid_parameter(context);
}
if (netconfig_execute_file(path, args, envs) < 0) {
DBG("Failed to remove the route");
netconfig_error_permission_denied(context);
}
if (netconfig_execute_file(path, args, envs) < 0) {
DBG("Failed to remove the route");
netconfig_error_permission_denied(context);
}
break;
case AF_INET6:
if (ip_addr == NULL || interface == NULL || gateway == NULL) {
DBG("Invalid parameter!");
netconfig_error_invalid_parameter(context);
}
break;
case AF_INET6:
if (ip_addr == NULL || interface == NULL || gateway == NULL) {
DBG("Invalid parameter!");
netconfig_error_invalid_parameter(context);
- buf = ip_addr;
- ch = strchr(buf, '/');
- pos = ch - buf + 1;
- if (ch) {
- prefix_len = atoi(ch + 1);
- ip_addr[pos-1] = '\0';
- } else {
- prefix_len = 128;
- }
-
- if (netconfig_del_route_ipv6(ip_addr, interface, gateway, prefix_len) < 0) {
+ if (netconfig_del_route_ipv6(interface, gateway) < 0) {