}
- GNUNET_asprintf(&cmdline, "ss %s \\( sport = :%u or dport = :%u \\)", proto, port, port);
+ GNUNET_asprintf(&cmdline, "netstat -n %s | grep %u", proto, port);
- if (system ("ss > /dev/null 2> /dev/null"))
- if (system ("ss > /dev/null 2> /dev/null") == 0)
+ if (system ("netstat -n > /dev/null 2> /dev/null"))
+ if (system ("netstat -n > /dev/null 2> /dev/null") == 0)
f = popen (cmdline, "r");
else
f = NULL;
return -1;
}
+ count = 0;
while (NULL != fgets (line, sizeof (line), f))
{
/* read */
-
//printf ("%s", line);
count ++;
}
if (GNUNET_YES == have_tcp)
{
struct TransportPlugin * p = find_plugin ("tcp");
- int low_level_connections_tcp = check_lowlevel_connections (p->port, tcp);
+ int low_level_connections_tcp = check_lowlevel_connections (p->port, p->protocol);
if (low_level_connections_tcp != -1)
{