[SIGAR-5] Fix netinfo default gateway
This commit is contained in:
parent
ec58e28f34
commit
071ca22aba
|
@ -1,3 +1,8 @@
|
|||
2006-06-09 Doug MacEachern <dougm@hyperic.com>
|
||||
|
||||
* [SIGAR-5] Fix netinfo default gateway where the first gateway in the routing table
|
||||
had been selected without checking for the default destination == 0.0.0.0
|
||||
|
||||
2006-05-30 Doug MacEachern <dougm@hyperic.com>
|
||||
|
||||
* Prevent possible integer overflow in filesystem_usage
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue