From fc24578d831481c6a6e5af3d8060a048263739b6 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 3 Dec 2005 01:31:54 +0000 Subject: [PATCH] fix net_route_list for solaris 10 --- src/os/solaris/solaris_sigar.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/os/solaris/solaris_sigar.c b/src/os/solaris/solaris_sigar.c index d6062db3..f20197d0 100644 --- a/src/os/solaris/solaris_sigar.c +++ b/src/os/solaris/solaris_sigar.c @@ -1512,6 +1512,13 @@ int sigar_net_route_list_get(sigar_t *sigar, char *data; int len, rc; struct opthdr *op; + size_t nread=0, size=sizeof(mib2_ipRouteEntry_t); + + if (sigar->solaris_version >= 10) { + size += /* bincompat for new solaris 10 fields */ + sizeof(DeviceName) + + sizeof(IpAddress); + } sigar_net_route_list_create(routelist); @@ -1524,7 +1531,8 @@ int sigar_net_route_list_get(sigar_t *sigar, } for (entry = (mib2_ipRouteEntry_t *)data, end = data + len; - (char *)entry < end; entry++) + (char *)entry < end; + entry = (mib2_ipRouteEntry_t *)((char *)data+nread), nread+=size) { sigar_net_route_t *route; int type = entry->ipRouteInfo.re_ire_type;