aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-05-09 02:22:43 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-05-11 02:45:11 -0400
commitdb0ccffed91e234cad99a35f07d5a322f410baa2 (patch)
treea83a513181ec767ad533ca30d06837eb107961b7 /net
parent4cd8c9e87be7ea891050ff1bebbf767a837eb5cf (diff)
[NET] link_watch: Eliminate potential delay on wrap-around
When the jiffies wrap around or when the system boots up for the first time, down events can be delayed indefinitely since we no longer update linkwatch_nextevent when only urgent events are processed. This patch fixes this by setting linkwatch_nextevent when a wrap-around occurs. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/link_watch.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/core/link_watch.c b/net/core/link_watch.c
index b5f45799c2f..4674ae57412 100644
--- a/net/core/link_watch.c
+++ b/net/core/link_watch.c
@@ -101,8 +101,10 @@ static void linkwatch_schedule_work(unsigned long delay)
101 return; 101 return;
102 102
103 /* If we wrap around we'll delay it by at most HZ. */ 103 /* If we wrap around we'll delay it by at most HZ. */
104 if (delay > HZ) 104 if (delay > HZ) {
105 linkwatch_nextevent = jiffies;
105 delay = 0; 106 delay = 0;
107 }
106 108
107 schedule_delayed_work(&linkwatch_work, delay); 109 schedule_delayed_work(&linkwatch_work, delay);
108} 110}