From 26fc2d674b51bd0b5679db45bde008fd9af86fa4 Mon Sep 17 00:00:00 2001 From: Markus Pfeiffer Date: Thu, 20 Nov 2014 00:30:59 +0000 Subject: [PATCH] dhclient: Update linkstate after poll The ifi->linkstat variable seemed to be not updated after the poll returns in dispatch.c. This might only be a hack, but it makes the busylooping go away. --- sbin/dhclient/dispatch.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c index fdad0c7..b9cc113 100644 --- a/sbin/dhclient/dispatch.c +++ b/sbin/dhclient/dispatch.c @@ -164,10 +164,16 @@ another: } if ((fds[0].revents & (POLLIN | POLLHUP))) { - if (ifi && ifi->linkstat && ifi->rfdesc != -1) + /* XXX profmakx: I am not sure whether updating the linkstate + here is the best idea, but it being not up to date leads + to a busy loop */ + ifi->linkstat = interface_status(ifi->name); + if (ifi && ifi->linkstat && ifi->rfdesc != -1) { got_one(); + } } if ((fds[1].revents & (POLLIN | POLLHUP))) { + note("fd1 ifi %p\n", ifi); if (ifi) routehandler(); } -- 2.1.2