set some route flags

This commit is contained in:
Doug MacEachern 2005-07-12 18:45:28 +00:00
parent 300ef18259
commit 9c20564afa
2 changed files with 14 additions and 0 deletions

View File

@ -729,6 +729,13 @@ int sigar_net_route_list_get(sigar_t *sigar,
route->destination = ent->Dest; route->destination = ent->Dest;
route->mask = ent->Mask; route->mask = ent->Mask;
route->gateway = ent->NextHop; route->gateway = ent->NextHop;
route->flags = SIGAR_RTF_UP;
if ((route->destination == 0) &&
(route->mask == 0))
{
route->flags |= SIGAR_RTF_GATEWAY;
}
} }
free(routes); free(routes);

View File

@ -1725,6 +1725,13 @@ SIGAR_DECLARE(int) sigar_net_route_list_get(sigar_t *sigar,
route->destination = ipr->dwForwardDest; route->destination = ipr->dwForwardDest;
route->mask = ipr->dwForwardMask; route->mask = ipr->dwForwardMask;
route->gateway = ipr->dwForwardNextHop; route->gateway = ipr->dwForwardNextHop;
route->flags = SIGAR_RTF_UP;
if ((route->destination == 0) &&
(route->mask == 0))
{
route->flags |= SIGAR_RTF_GATEWAY;
}
} }
free(buffer); free(buffer);