Re: snmpd creating dirty buffers on a D-Link DFE-580TX [solved]
"Dave Shield" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
2008/4/30 richard lucassen <[email protected]>: > Ok, I have a few machines around with this particular NIC. On some it > isn't (wasn't) possible to run snmpd. So I just compiled the source from > Debian unstable (5.4.1) and installed that version. But unfortunately > without result: [snip] > > If you really want I can try the latest tarball, but I understand that > this should not make much difference from the 5.4.1 version. No, you're quite correct. The current development code is no different to the 5.4.1 distribution. I'm attaching a patch (untested) which should address this issue. If this helps, we can look at including it within the various code lines. Dave ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
interface_linux.c.diff
(application/octet-stream, 1.3 KB)
Index: interface_linux.c
===================================================================
--- agent/mibgroup/if-mib/data_access/interface_linux.c (revision 16898)
+++ agent/mibgroup/if-mib/data_access/interface_linux.c (working copy)
@@ -828,7 +828,6 @@
*/
ushort *data = (ushort *)(&ifr.ifr_data);
unsigned phy_id;
- unsigned char new_ioctl_nums = 0;
int mii_reg, i;
ushort mii_val[32];
ushort bmcr, bmsr, nway_advert, lkpar;
@@ -839,11 +838,7 @@
ifr.ifr_name[ sizeof(ifr.ifr_name)-1 ] = 0;
data[0] = 0;
- if (ioctl(fd, 0x8947, &ifr) >= 0) {
- new_ioctl_nums = 1;
- } else if (ioctl(fd, SIOCDEVPRIVATE, &ifr) >= 0) {
- new_ioctl_nums = 0;
- } else {
+ if (ioctl(fd, SIOCGMIIPHY, &ifr) < 0) {
DEBUGMSGTL(("mibII/interfaces", "SIOCGMIIPHY on %s failed\n",
ifr.ifr_name));
return retspeed;
@@ -854,7 +849,7 @@
for (mii_reg = 0; mii_reg < 8; mii_reg++){
data[0] = phy_id;
data[1] = mii_reg;
- if(ioctl(fd, new_ioctl_nums ? 0x8948 : SIOCDEVPRIVATE+1, &ifr) <0){
+ if(ioctl(fd, SIOCGMIIREG, &ifr) <0){
DEBUGMSGTL(("mibII/interfaces", "SIOCGMIIREG on %s failed\n", ifr.ifr_name));
}
mii_val[mii_reg] = data[3];