Hi,
Iam using net-snmp 5.3.0.1 release on montavista linux platform.
I have added one static route entry on my router and when i try to access ip mib from snmp it is showing the added entry and when i remove that static route entry from my routing table , it is still visible through snmp browser. I have waited for long time ,then also that entry doesnt got deleted.
This may be because , we are not checking flags entry in /proc/net/route , if flags entry is 0x0000 then route is not usable.
I have put this fix in _load_ipv4 function in route_linux.c file and it seems to be working.
if ((8 != rc)||(!(iflags & RTF_UP)) //RTF_UP route usable.
continue;
Iam not so sure whether it is right or not . or any other place this condition has been handled. Please let me know.
-Salauddin.
rc = sscanf(line, "%s %x %x %x %u %d %d %x %*d %*d %*d\n",
rtent_name, &dest, &nexthop,
/*
* XXX: fix type of the args
*/
&flags, &refcnt, &use, &entry->rt_metric1,
&tmp_mask);
DEBUGMSGTL(("9:access:route:container", "line |%s|\n", line));
+ if ((8 != rc)||(!(iflags & RTF_UP))) {
snmp_log(LOG_ERR,
"/proc/net/route data format error (%d!=8), line ==|%s|",
rc, line);
continue;
}
rtent_name, &dest, &nexthop,
/*
* XXX: fix type of the args
*/
&flags, &refcnt, &use, &entry->rt_metric1,
&tmp_mask);
DEBUGMSGTL(("9:access:route:container", "line |%s|\n", line));
+ if ((8 != rc)||(!(iflags & RTF_UP))) {
snmp_log(LOG_ERR,
"/proc/net/route data format error (%d!=8), line ==|%s|",
rc, line);
continue;
}
What are the most popular cars? Find out at Yahoo! Autos
