diff options
author | hm <hm@FreeBSD.org> | 2001-07-21 11:29:40 +0000 |
---|---|---|
committer | hm <hm@FreeBSD.org> | 2001-07-21 11:29:40 +0000 |
commit | 5276a48c0f55b5d7d43ee87dd77c16aa33f49e14 (patch) | |
tree | 3583165b1bf1a5fe357b3e0ec9a13e8bb2dd3f7e /usr.sbin/i4b/isdnd/timer.c | |
parent | a67f578d2b31873dd3b9906157d4998436a6b327 (diff) | |
download | FreeBSD-src-5276a48c0f55b5d7d43ee87dd77c16aa33f49e14.zip FreeBSD-src-5276a48c0f55b5d7d43ee87dd77c16aa33f49e14.tar.gz |
After being port- and addressscanned continously from several sources where
my line stayed open for more than eight hours i decided to implement a
maximum connection time; see keyword maxconnecttime in the manual page.
Diffstat (limited to 'usr.sbin/i4b/isdnd/timer.c')
-rw-r--r-- | usr.sbin/i4b/isdnd/timer.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/usr.sbin/i4b/isdnd/timer.c b/usr.sbin/i4b/isdnd/timer.c index b2b7630..2632137 100644 --- a/usr.sbin/i4b/isdnd/timer.c +++ b/usr.sbin/i4b/isdnd/timer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved. + * Copyright (c) 1997, 2001 Hellmuth Michaelis. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,11 +27,9 @@ * i4b daemon - timer/timing support routines * ------------------------------------------ * - * $Id: timer.c,v 1.21 2000/05/03 09:32:38 hm Exp $ - * * $FreeBSD$ * - * last edit-date: [Tue May 2 15:58:31 2000] + * last edit-date: [Fri Jul 20 20:29:28 2001] * *---------------------------------------------------------------------------*/ @@ -227,6 +225,20 @@ handle_active(cfg_entry_t *cep, time_t now) next_state(cep, EV_DRQ); } + /* check maximum connect time reached */ + + if(cep->maxconnecttime > 0 && cep->connect_time > 0) + { + int connecttime = (int)difftime(now, cep->connect_time); + if(connecttime > cep->maxconnecttime) + { + DBGL(DL_RCVRY, (log(LL_DBG, + "handle_active: entry %s, maxconnecttime %d reached!", + cep->name, cep->maxconnecttime))); + next_state(cep, EV_DRQ); + } + } + /* * if shorthold mode is rates based, check if * we entered a time with a new unit length |