Author: pfg
Date: Sat Oct 28 21:26:49 2017
New Revision: 325067
URL: https://svnweb.freebsd.org/changeset/base/325067

Log:
  bsnmpd: Only refresh devtree if devd event is a new or removed device.
  
  It makes sense to refresh the tree only when a device is inserted or
  removed, otherwise bsnmpd wastes lot of CPU.
  
  PR:           209368
  MFC after:    1 week

Modified:
  head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c

Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c
==============================================================================
--- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c      Sat Oct 
28 20:09:34 2017        (r325066)
+++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c      Sat Oct 
28 21:26:49 2017        (r325067)
@@ -479,7 +479,9 @@ again:
        } else {
                if (read_len == sizeof(buf))
                        goto again;
-               refresh_device_tbl(1);
+               /* Only refresh device table on a device add or remove event. */
+               if (buf[0] == '+' || buf[0] == '-')
+                       refresh_device_tbl(1);
        }
 }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to