From a463409833b9a79418806122327a6ca3312501e8 Mon Sep 17 00:00:00 2001
From: Julien BLACHE <julien-externe.blache@edf.fr>
Date: Tue, 10 Aug 2010 13:57:41 +0200
Subject: [PATCH] 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.
---
 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 d46aa5e..f00041b 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)) {
-- 
1.5.6.5

