hostap with snmpd and mrtg

wasik wasik
Thu Jul 1 08:53:45 PDT 2004


Hello,
I'm using MRTG (traffic grapher) with snmpd on machine with hostap. Every time  MRTG reads traffic counter (ie. every five minutes) I get lot of these lines in syslog:
Jul  1 17:23:35 h kernel: wlan0 unsupported ioctl(0x8947)
Jul  1 17:23:35 h kernel: wlan0 unsupported ioctl(0x89f0)

It is caused by snmpd which does SIOCGMIIPHY and SIOCDEVPRIVATE ioctls
each time network information is requested - ifInOctets in this case.

I made a simple patch for hostap to silently ignore those ioctls.

  Jan Wasserbauer

-------------- next part --------------
diff -ru -x '*.o' -x '.*' -x '*~' hostap-driver-0.2.3/driver/modules/hostap_ioctl.c hostap-driver-0.2.3.mod/driver/modules/hostap_ioctl.c
--- hostap-driver-0.2.3/driver/modules/hostap_ioctl.c	2004-03-24 04:47:59.000000000 +0100
+++ hostap-driver-0.2.3.mod/driver/modules/hostap_ioctl.c	2004-07-01 17:43:47.000000000 +0200
@@ -3667,9 +3667,14 @@
 		break;
 
 	default:
-		if (cmd >= SIOCSIWCOMMIT && cmd <= SIOCGIWPOWER) {
-			/* unsupport wireless extensions get through here - do
+		if ((cmd >= SIOCSIWCOMMIT && cmd <= SIOCGIWPOWER)
+	      		/* unsupport wireless extensions get through here - do
 			 * not report these to debug log */
+			|| cmd == SIOCGMIIPHY || cmd == SIOCGMIIREG 
+			|| cmd == SIOCSMIIREG || cmd == SIOCDEVPRIVATE)
+			/* these ioctls cause lot of warning lines when using
+			 * snmpd & mrtg */
+		{
 			ret = -EOPNOTSUPP;
 			break;
 		}



More information about the Hostap mailing list