gchar *const args[] = { "/sbin/route", "del", "-net", ip_addr, gw_str,
"netmask", netmask, "dev", interface, NULL };
char *const envs[] = { NULL };
- const char* buf = NULL;
- char* ch = NULL;
- int prefix_len = 0;
- int pos = 0;
DBG("ip_addr(%s), netmask(%s), interface(%s), gateway(%s)", ip_addr, netmask, interface, gateway);
return TRUE;
}
- 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) {
DBG("Failed to remove the route");
netconfig_error_permission_denied(context);
return TRUE;