[SIGAR-5] Fix netinfo default gateway
This commit is contained in:
1 parent
ec58e28f34
commit
071ca22aba
2 files changed
+8
-1
No files matched your search
+3
-1
@@ -927,7 +927,9 @@ static int sigar_get_default_gateway(sigar_t *sigar,
|
||||
}
|
||||
|
||||
for (i=0; i<routelist.number; i++) {
|
||||
if (routelist.data[i].flags & SIGAR_RTF_GATEWAY) {
|
||||
if ((routelist.data[i].flags & SIGAR_RTF_GATEWAY) &&
|
||||
(routelist.data[i].destination == 0))
|
||||
{
|
||||
sigar_inet_ntoa(sigar,
|
||||
routelist.data[i].gateway, gateway);
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user