stp: Fix tick remainder calculation.
authorJustin Pettit <jpettit@nicira.com>
Tue, 15 Nov 2011 08:20:09 +0000 (00:20 -0800)
committerJustin Pettit <jpettit@nicira.com>
Tue, 15 Nov 2011 18:18:04 +0000 (10:18 -0800)
commit7651845860d8a386ee5f446961e02fc362a99eef
treef5286b27553dea04b1f326bbf2a6b83e1935f825
parentb6433ee2833e84b2d50f060896b8cb9129a3ca46
stp: Fix tick remainder calculation.

The spanning tree library keeps track of time to know how often it
should update its state and send out BPDUs.  OVS is able to track time
in milliseconds, but STP uses a coarser-grained count (256 ticks per
second).  To prevent losing milliseconds that didn't account for an
entire tick, the library keeps track of these remaining milliseconds.  A
bug miscalculated the remainder and made it too high, which caused the
library to think time was passing more quickly than it was.

This bug wasn't noticeable on a quiet system, since STP only asks to be
woken every second.  However, a system with a lot of activity would wake
OVS more frequently and have it call the subsystems' "run" functions.

Bug #8283
lib/stp.c