In some cases, ipconfig can take longer than the user-specified timeouts, causing unexpected delays.
in main.c, in function loop(), the process can go into process_timeout_event() (or process_receive_event() ) and if it encounters an error situation, will set an attempt to "try again later" at time equal now + 10 seconds by setting
s->expire = now + 10;
This can happen at any time during the main event loop, which can end up extending the user-specified timeout if "now + 10" is greater than "start_time + user-specified-timeout".
I believe a patch like the following is needed to avoid this problem:
In some cases, ipconfig can take longer than the user-specified timeouts, causing unexpected delays.
in main.c, in function loop(), the process can go into process_ timeout_ event() (or process_ receive_ event() ) and if it encounters an error situation, will set an attempt to "try again later" at time equal now + 10 seconds by setting
s->expire = now + 10;
This can happen at any time during the main event loop, which can end up extending the user-specified timeout if "now + 10" is greater than "start_time + user-specified- timeout" .
I believe a patch like the following is needed to avoid this problem:
--- a/usr/kinit/ ipconfig/ main.c ipconfig/ main.c
+++ b/usr/kinit/
@@ -437,6 +437,13 @@ static int loop(void)
+
+ /* Compensate for already-lost time */
+ gettimeofday(&now, NULL);
+ if (now.tv_sec + timeout > start + loop_timeout) {
+ timeout = loop_timeout - (now.tv_sec - start);
+ printf("Lowered timeout to match user request = (%d s) \n", timeout);
+ }
}