summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-10-02 23:19:20 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-10-02 23:19:20 +0000
commit54c63e3a00c55f7e6bf86162e4e4971fab1cacb8 (patch)
tree1663de795806d24a3308b9b7ce363804a38e5ee9 /usr.sbin
parent1f585af57a31889e5fb449cf5b1c2ac45a3160c5 (diff)
Repair "set reconnect random 0" from PR 5368. This bug report was ignored
since Feb 2007, even though it had a patch. How did this happen??
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ppp/ppp/datalink.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/ppp/ppp/datalink.c b/usr.sbin/ppp/ppp/datalink.c
index 80273d21078..b19a600c959 100644
--- a/usr.sbin/ppp/ppp/datalink.c
+++ b/usr.sbin/ppp/ppp/datalink.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: datalink.c,v 1.47 2005/07/18 22:51:03 brad Exp $
+ * $OpenBSD: datalink.c,v 1.48 2008/10/02 23:19:19 deraadt Exp $
*/
#include <sys/param.h>
@@ -1158,7 +1158,13 @@ int
datalink_SetReconnect(struct cmdargs const *arg)
{
if (arg->argc == arg->argn+2) {
- arg->cx->cfg.reconnect.timeout = atoi(arg->argv[arg->argn]);
+ if (strncasecmp(arg->argv[arg->argn], "random", 6) == 0 &&
+ (arg->argv[arg->argn][6] == '\0')) {
+ arg->cx->cfg.reconnect.timeout = -1;
+ randinit();
+ } else {
+ arg->cx->cfg.reconnect.timeout = atoi(arg->argv[arg->argn]);
+ }
arg->cx->cfg.reconnect.max = atoi(arg->argv[arg->argn+1]);
return 0;
}