summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/sig.c
Commit message (Collapse)AuthorAgeFilesLines
* Maintain a `necessary' marker to indicate that we *probably*brian1999-03-301-11/+23
| | | | | | | | | | | | | | | need to process a signal (usually a SIGALRM). Check to see if we need to process a signal both before *and* after calling select() as older (pre-2.0) versions of ppp used to. This handles the possibility that ppp may block at some point (maybe due to an open() of a misconfigured device). Previously, we'd potentially lock up in select(). The `necessary' marker reduces the increased signal checking overhead so that at full speed with no compression transferring an 83Mb file via a ``!ppp -direct'' device, we get a 1% throughput gain.
* MFMP: Make ppp multilink capable.brian1998-05-211-6/+4
| | | | See the file README.changes, and re-read the man page.
* Explicitly call `caused' an `int'.brian1998-03-081-2/+2
| | | | Sugested by: gcc-2.8
* Add (BSD) copyright headers.brian1997-12-211-2/+26
|
* Fix prototypes.brian1997-11-221-2/+3
| | | | | | | | | | | | | | Remove extraneous decls. Add ``const'' to several places. Allow ``make NOALIAS=1'' to remove IP aliasing. Merge with OpenBSD - only the Makefiles vary. We can now survive a compile with -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -Wchar-subscripts (although the Makefile just contains -Wall).
* Cosmetic (no functional changes):brian1997-10-261-33/+5
| | | | | | | | | | | | | | | o Add missing $Id$s o Move extern decls from .c -> .h files o Staticize o Remove #includes from .h files o style(9)ify includes o bcopy -> memcpy bzero -> memset bcmp -> memcmp index -> strchr rindex -> strrchr o Move timeout.h -> timer.h (making it consistent w/ timer.c) o Add -Wmissing-prototypes
* Make the code format more in line with style(9).brian1997-08-251-36/+41
| | | | | Update loadalias to use the new libalias api. Update to version 1.1.
* Overhaul ppp:brian1997-06-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | o Use syslog o Remove references to stdout/stderr (incl perror()) o Introduce VarTerm - the interactive terminal or zero o Allow "set timeout" to affect current session o Change "set debug" to "set log" o Allow "set log [+|-]flag" o Make MSEXT and PASSWDAUTH stuff the default o Move all #ifdef DEBUG stuff into the code - this shouldn't be too much overhead. It's now controlled with "set log +debug" o Add "set log command, debug, tun, warn, error, alert" o Remove cdefs.h, and assume an ansi compiler. o Improve all diagnostic output o Don't trap SIGSEGV o SIGHUP now terminates again (log files are controlled by syslog) o Call CloseModem() when changing devices o Fix parsing of third arg of "delete" I think this fixes the "magic is same" problems that some people have been experiencing. The man page is being rewritten. It'll follow soon.
* Reviewed by: ache@freebsd.orgbrian1997-03-131-0/+95
| | | | | | | | These changes should fix the signal "problems" in ppp. The signal changes should really be put into 2.2 too ! The following patches should do it. There were some other changes made by Andrey recently that havn't been brought into 2.2, it may be worth doing them now.
* I remove pending signals completely, they are not useless, they areache1997-03-091-91/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dangerous! Signal handlers themself must be fixed to not call malloc, but no pended handlers, it will be correct fix. In finite case each signal handler can set some variable which will be analized later, but calling handler functions manually is too dangerous (f.e. signals not blocked while the handler or handlers switch executed in this case). Of course this code can be fixed instead of removing, but it not worth fixing in any case. Should go into 2.2 In addition sig.c code shows following dangerous fragments (there can be more, but I stop after two): This fragment if (fn == SIG_DFL || fn == SIG_IGN) { handler[sig-1] = (sig_type)0; <------------- here signal(sig,fn); } else { cause NULL pointer reference when signal comes "here", but more worse fragment is below: void handle_signals() { int sig; if (caused) for (sig=0; sig<__MAXSIG; sig++, caused>>=1) if (caused&1) (*handler[sig])(sig+1); } caused is bitmask which set corresponding bit on each signal coming. And now imagine, what happens when some signal comes (bit sets) while loop is executed (see caused>>=1 !!!) In this light carrier drop situation was (as gdb shows) 1. SIGSEGV in handle_signals because some junk called as *handler reference. 2. Since SIGSEGV was pended too (== never happens), it can cause various range of disasters.
* osreldate.h stuff suggested by: Eivind Eklundbrian1997-02-251-1/+3
| | | | | | | | Remove #include's from sig.h and get dependant modules to include them themselves. Make inclusion of if_var.h depend on __FreeBSD_version so that the -current version of ppp can be used with 2.1.* 2.2 Candidate ?
* Requested by: Elvind Eklundbrian1997-02-231-5/+5
| | | | Remove usage of __sighandler_t as it's not available in 2.1*
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Tidy up signal handling.brian1997-02-191-0/+89
All signal() calls have been changed to pending_signal() calls. pending_signal() is defined in the new sig.c file. It remembers the handler and traps the signal with a function that will remember the signal. main.c now calls handle_signals() to actually call the required handlers (if the above handler was called). If this doesn't close PR2662 (was PR2347), I'll cry. Joerg, I think this should go into 2.2, but I havn't done anything about it because I'm bound to botch it with the new sig.[ch] files. I've just "cvs add"'d sig.[ch] so far.... can you update to 2.2 and tell me what you did ? Thanks.
OpenPOWER on IntegriCloud