summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Filippov <a.filippov@yadro.com>2018-11-29 15:31:42 +0300
committerAlexander Filippov <a.filippov@yadro.com>2018-11-29 16:17:02 +0300
commit74db23cf883c6eb9d1f10aaff57b9cc167cb0868 (patch)
tree94fba9af33820c400da4593853cf32fdba8cf6d9
parent79e4415fff20c0fb01d00b4f78d0de432d0e7e9a (diff)
downloadphosphor-networkd-74db23cf883c6eb9d1f10aaff57b9cc167cb0868.tar.gz
phosphor-networkd-74db23cf883c6eb9d1f10aaff57b9cc167cb0868.zip
Fix checking the status of timer
With the new implementation of the timer (the commit 3a70fa24fc016a06b0dc2ecdc3c7275d1f25425c), we catch the bug in the logic of the rt-link events handler: If the timer is not started yet, it will never expire. This commit adds the additional check for the timer activity. Resolves openbmc/openbmc#3437 Change-Id: I0f8c165c626cc649af8d6550407d2a640f691fce Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
-rw-r--r--rtnetlink_server.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/rtnetlink_server.cpp b/rtnetlink_server.cpp
index ed5f8c9..9daf9ad 100644
--- a/rtnetlink_server.cpp
+++ b/rtnetlink_server.cpp
@@ -46,7 +46,8 @@ static int eventHandler(sd_event_source* es, int fd, uint32_t revents,
{
// starting the timer here to make sure that we don't want
// create the child objects multiple times.
- if (refreshObjectTimer->hasExpired())
+ if (!refreshObjectTimer->isEnabled() ||
+ refreshObjectTimer->hasExpired())
{
// if start timer throws exception then let the application
// crash
OpenPOWER on IntegriCloud