Bug 132993 - [patch] bsnmpd(1) - bad IfPoll timer interval
Summary: [patch] bsnmpd(1) - bad IfPoll timer interval
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Gleb Smirnoff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-24 09:10 UTC by Vitezslav Novy
Modified: 2019-01-09 05:55 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vitezslav Novy 2009-03-24 09:10:01 UTC
begemotIfPoll timer interval is set to value 10 times higher then should be.

Timer interval is correctly counted in ticks (1/100 s) in function  mibif_reset_hc_timer (in file  contrib/bsnmp/snmp_mibII/mibII.c:375)
Then timer_start_repeat is called. This function expects ticks (1/100 s) as parameter, but is called with miliseconds.

Fix: 

contrib/bsnmp/snmp_mibII/mibII.c

406c406
<       if ((hc_update_timer = timer_start_repeat(ticks * 10, ticks * 10,
---
>       if ((hc_update_timer = timer_start_repeat(ticks, ticks,
How-To-Repeat: Start
/usr/sbin/bsnmpd -d -D events

and in debug output look at 1st parameter of poll_start_utimer.
Comment 1 Eugene Grosbein freebsd_committer 2017-06-11 13:53:40 UTC
HC polling code was submitter by glebius in 2006. Perhaps, he can tell if 10x multiplier was intentional.
Comment 2 commit-hook freebsd_committer 2019-01-09 05:54:42 UTC
A commit references this bug:

Author: glebius
Date: Wed Jan  9 05:53:59 UTC 2019
New revision: 342877
URL: https://svnweb.freebsd.org/changeset/base/342877

Log:
  Timer interval is correctly counted in ticks (1/100 s) in
  mibif_reset_hc_timer().  Multiplication by 10 is erroneous
  and is probably a blind copy and paste from next function.

  PR:		132993
  Submitted by:	Vitezslav Novy <vnovy vnovy.net>

Changes:
  head/contrib/bsnmp/snmp_mibII/mibII.c
Comment 3 Gleb Smirnoff freebsd_committer 2019-01-09 05:55:45 UTC
Fixed in head. Thanks!