diff --git a/RELNOTES b/RELNOTES index 86a1cb4d..5cc71506 100644 --- a/RELNOTES +++ b/RELNOTES @@ -92,6 +92,11 @@ work on other platforms. Please report any problems and suggested fixes to objects. [ISC-Bugs #27452] +- Added a sleep call after killing the old client to allow time + for the sockets to be cleaned. This should allow the -r option + to work more consistently. + [ISC-Bugs #18175] + Changes since 4.2.4 - Correct code to calculate timing values in client to compare diff --git a/client/dhclient.c b/client/dhclient.c index cfcf10cd..aac80844 100644 --- a/client/dhclient.c +++ b/client/dhclient.c @@ -404,8 +404,16 @@ main(int argc, char **argv) { oldpid = (pid_t)temp; if (e != 0 && e != EOF) { - if (oldpid) - kill(oldpid, SIGTERM); + if (oldpid && (kill(oldpid, SIGTERM) == 0)) { + /* + * wait for the old process to + * cleanly terminate. + * Note kill() with sig=0 could + * detect termination but only + * the parent can be signaled... + */ + sleep(1); + } } fclose(pidfd); }