From: Antonio Huete Jimenez Date: Sat, 4 Aug 2012 18:59:03 +0000 (+0200) Subject: dhclient - Cancel all timeouts in state_reboot(). X-Git-Tag: v3.2.0~323 X-Git-Url: http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/86cc4af65d79535ccfb597169e666b66a88a8abd dhclient - Cancel all timeouts in state_reboot(). - We can get there from any state if a link state change happens. Fixes a problem where we'd continue to send (corrupted) discover packets after binding. Taken-from: OpenBSD --- diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 816ba2c..e956f5e 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: src/sbin/dhclient/dhclient.c,v 1.142 2011/12/10 15:55:43 krw Exp $ */ +/* $OpenBSD: src/sbin/dhclient/dhclient.c,v 1.143 2012/06/20 21:53:51 kettenis Exp $ */ /* * Copyright 2004 Henning Brauer @@ -452,6 +452,14 @@ usage(void) void state_reboot(void) { + /* Cancel all timeouts, since a link state change gets us here + and can happen anytime. */ + cancel_timeout(state_init); + cancel_timeout(state_selecting); + cancel_timeout(state_bound); + cancel_timeout(send_discover); + cancel_timeout(send_request); + /* If we don't remember an active lease, go straight to INIT. */ if (!client->active || client->active->is_bootp) { state_init();