Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 102767
Collapse All | Expand All

(-)ppp-2.4.2/pppd/auth.c (+4 lines)
Lines 1053-1058 Link Here
1053
	itime = MIN(idle.xmit_idle, idle.recv_idle);
1053
	itime = MIN(idle.xmit_idle, idle.recv_idle);
1054
	tlim = idle_time_limit - itime;
1054
	tlim = idle_time_limit - itime;
1055
    }
1055
    }
1056
    if (extidle) {
1057
	itime = time() - reset_time;
1058
	tlim = idle_time_limit - itime;
1059
    }
1056
    if (tlim <= 0) {
1060
    if (tlim <= 0) {
1057
	/* link is idle: shut it down. */
1061
	/* link is idle: shut it down. */
1058
	notice("Terminating connection due to lack of activity.");
1062
	notice("Terminating connection due to lack of activity.");
(-)ppp-2.4.2/pppd/main.c (-1 / +15 lines)
Lines 149-154 Link Here
149
int got_sigusr2;
149
int got_sigusr2;
150
int got_sigterm;
150
int got_sigterm;
151
int got_sighup;
151
int got_sighup;
152
int got_sigalrm;
152
153
153
static int waiting;
154
static int waiting;
154
static sigjmp_buf sigjmp;
155
static sigjmp_buf sigjmp;
Lines 204-209 Link Here
204
static void hup __P((int));
205
static void hup __P((int));
205
static void term __P((int));
206
static void term __P((int));
206
static void chld __P((int));
207
static void chld __P((int));
208
static void alrm __P((int));
207
static void toggle_debug __P((int));
209
static void toggle_debug __P((int));
208
static void open_ccp __P((int));
210
static void open_ccp __P((int));
209
static void bad_signal __P((int));
211
static void bad_signal __P((int));
Lines 721-733 Link Here
721
723
722
    SIGNAL(SIGUSR1, toggle_debug);	/* Toggle debug flag */
724
    SIGNAL(SIGUSR1, toggle_debug);	/* Toggle debug flag */
723
    SIGNAL(SIGUSR2, open_ccp);		/* Reopen CCP */
725
    SIGNAL(SIGUSR2, open_ccp);		/* Reopen CCP */
726
    SIGNAL(SIGALRM, alrm);		/* Reset activity timer */ 
724
727
725
    /*
728
    /*
726
     * Install a handler for other signals which would otherwise
729
     * Install a handler for other signals which would otherwise
727
     * cause pppd to exit without cleaning up.
730
     * cause pppd to exit without cleaning up.
728
     */
731
     */
729
    SIGNAL(SIGABRT, bad_signal);
732
    SIGNAL(SIGABRT, bad_signal);
730
    SIGNAL(SIGALRM, bad_signal);
731
    SIGNAL(SIGFPE, bad_signal);
733
    SIGNAL(SIGFPE, bad_signal);
732
    SIGNAL(SIGILL, bad_signal);
734
    SIGNAL(SIGILL, bad_signal);
733
    SIGNAL(SIGPIPE, bad_signal);
735
    SIGNAL(SIGPIPE, bad_signal);
Lines 1402-1407 Link Here
1402
1404
1403
1405
1404
/*
1406
/*
1407
 * alrm - Catch SIGALRM signal.
1408
 * Resets external timeout timer.
1409
 */
1410
static void
1411
alrm(sig)
1412
    int sig;
1413
{
1414
    got_sigalrm = 1;
1415
    reset_time = time();
1416
}
1417
1418
/*
1405
 * toggle_debug - Catch SIGUSR1 signal.
1419
 * toggle_debug - Catch SIGUSR1 signal.
1406
 *
1420
 *
1407
 * Toggle debug flag.
1421
 * Toggle debug flag.
(-)ppp-2.4.2/pppd/options.c (+2 lines)
Lines 219-224 Link Here
219
219
220
    { "demand", o_bool, &demand,
220
    { "demand", o_bool, &demand,
221
      "Dial on demand", OPT_INITONLY | 1, &persist },
221
      "Dial on demand", OPT_INITONLY | 1, &persist },
222
    { "external-filter", o_bool, &extidle,
223
      "Use SIGALRM to wake up demand timer", OPT_INITONLY | 1},
222
224
223
    { "--version", o_special_noarg, (void *)showversion,
225
    { "--version", o_special_noarg, (void *)showversion,
224
      "Show version number" },
226
      "Show version number" },
(-)ppp-2.4.2/pppd/pppd.h (+2 lines)
Lines 245-250 Link Here
245
extern int      ppp_session_number; /* Session number (eg PPPoE session) */
245
extern int      ppp_session_number; /* Session number (eg PPPoE session) */
246
246
247
extern int	listen_time;	/* time to listen first (ms) */
247
extern int	listen_time;	/* time to listen first (ms) */
248
extern time_t	reset_time;	/* time of last SIGALRM */
248
extern struct notifier *pidchange;   /* for notifications of pid changing */
249
extern struct notifier *pidchange;   /* for notifications of pid changing */
249
extern struct notifier *phasechange; /* for notifications of phase changes */
250
extern struct notifier *phasechange; /* for notifications of phase changes */
250
extern struct notifier *exitnotify;  /* for notification that we're exiting */
251
extern struct notifier *exitnotify;  /* for notification that we're exiting */
Lines 289-294 Link Here
289
extern char	remote_name[MAXNAMELEN]; /* Peer's name for authentication */
290
extern char	remote_name[MAXNAMELEN]; /* Peer's name for authentication */
290
extern bool	explicit_remote;/* remote_name specified with remotename opt */
291
extern bool	explicit_remote;/* remote_name specified with remotename opt */
291
extern bool	demand;		/* Do dial-on-demand */
292
extern bool	demand;		/* Do dial-on-demand */
293
extern bool	extidle;	/* Use external idle/demand filter */
292
extern char	*ipparam;	/* Extra parameter for ip up/down scripts */
294
extern char	*ipparam;	/* Extra parameter for ip up/down scripts */
293
extern bool	cryptpap;	/* Others' PAP passwords are encrypted */
295
extern bool	cryptpap;	/* Others' PAP passwords are encrypted */
294
extern int	idle_time_limit;/* Shut down link if idle for this long */
296
extern int	idle_time_limit;/* Shut down link if idle for this long */

Return to bug 102767