diff options
author | Julien BLACHE <julien-externe.blache@edf.fr> | 2010-08-10 13:57:41 +0200 |
---|---|---|
committer | maximilian attems <max@stro.at> | 2010-08-25 20:04:16 +0200 |
commit | 47da4f6ab856250854465f88edc6d76ca0ba017b (patch) | |
tree | 91f187d88f3c3f3a15573bdac4fc1b7603d88d03 | |
parent | 73f0df27a6c8776510eba1d89da99ee6f6814527 (diff) | |
download | klibc-47da4f6ab856250854465f88edc6d76ca0ba017b.tar.gz |
[klibc] ipconfig: fix infinite loop
The first switch() statement in process_receive_event() did not
handle the DEVST_ERROR state, causing the timeout to be endlessly
increased by 10 seconds at each iteration in the second switch()
statement.
The second switch() statement is only here to catch state changes
caused by the first one, so DEVST_ERROR must be caught by the first
one to ignore the device until the timeout expires.
Tested-by: Michael Prokop <mika@debian.org>
Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r-- | usr/kinit/ipconfig/main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c index d46aa5ed6447e..f00041b325332 100644 --- a/usr/kinit/ipconfig/main.c +++ b/usr/kinit/ipconfig/main.c @@ -179,6 +179,9 @@ static int process_receive_event(struct state *s, time_t now) int handled = 1; switch (s->state) { + case DEVST_ERROR: + return 0; /* Not handled */ + case DEVST_BOOTP: s->restart_state = DEVST_BOOTP; switch (bootp_recv_reply(s->dev)) { |