in pppstart(), the output process may be overloaded to handle hardware
flow control and hardware output completions.
Don't wait for output to drain in slclose(). Discard output immediately.
New output is not prevented while processes are waiting for output to
drain (this is a bug), so the wait was sometimes forever. Infinite
waits are also possible when CCTS_OFLOW is enabled and CTS is down.
Infinite waits were also caused by the above bug in slstart().
Start changing new init stuff yet again: rename unused arg `dummy'.
Reviewed by: davidg
Submitted by: terry (terry lambert)
This is a composite of 3 patch sets submitted by terry.
they are:
New low-level init code that supports loadbal modules better
some cleanups in the namei code to help terry in 16-bit character support
some changes to the mount-root code to make it a little more
modular..
NOTE: mounting root off cdrom or NFS MIGHT be broken as I haven't been able
to test those cases..
certainly mounting root of disk still works just fine..
mfs should work but is untested. (tomorrows task)
The low level init stuff includes a total rewrite of init_main.c
to make it possible for new modules to have an init phase by simply
adding an entry to a TEXT_SET (or is it DATA_SET) list. thus a new module can
be added to the kernel without editing any other files other than the
'files' file.
Call output process whether or not there is any output. The output
process may be overloaded to handle hardware flow control and
hardware output completions.
Introduce TS_CONNECTED and TS_ZOMBIE states. TS_CONNECTED is set
while a connection is established. It is set while (TS_CARR_ON or
CLOCAL is set) and TS_ZOMBIE is clear. TS_ZOMBIE is set for on to
off transitions of TS_CARR_ON that occur when CLOCAL is clear and
is cleared for off to on transitions of CLOCAL. I/o can only occur
while TS_CONNECTED is set. TS_ZOMBIE prevents further i/o.
Split the input-event sleep address TSA_CARR_ON(tp) into TSA_CARR_ON(tp)
and TSA_HUP_OR_INPUT(tp). The former address is now used only for
off to on carrier transitions and equivalent CLOCAL transitions.
The latter is used for all input events, all carrier transitions
and certain CLOCAL transitions. There are some harmless extra
wakeups for rare connection- related events. Previously there were
too many extra wakeups for non-rare input events.
Drivers now call l_modem() instead of setting TS_CARR_ON directly
to handle even the initial off to on transition of carrier. They
should always have done this. l_modem() now handles TS_CONNECTED
and TS_ZOMBIE as well as TS_CARR_ON.
gnu/isdn/iitty.c:
Set TS_CONNECTED for first open ourself to go with bogusly setting
CLOCAL.
i386/isa/syscons.c, i386/isa/pcvt/pcvt_drv.c:
We fake carrier, so don't also fake CLOCAL.
kern/tty.c:
Testing TS_CONNECTED instead of TS_CARR_ON fixes TIOCCONS forgetting to
test CLOCAL. TS_ISOPEN was tested instead, but that broke when we disabled
the clearing of TS_ISOPEN for certain transitions of CLOCAL.
Testing TS_CONNECTED fixes ttyselect() returning false success for output
to devices in state !TS_CARR_ON && !CLOCAL.
Optimize the other selwakeup() call (this is not related to the other
changes).
kern/tty_pty.c:
ptcopen() can be declared in traditional C now that dev_t isn't short.
interface is no longer IFF_UP.
The test for IFF_UP in ifpromisc is only useful while enabling IFF_PROMISC
and the higher levels of the bpf code do not allow for the possibility of
failure while shutting down. This is a trivial change.
Also, fixes PR#522.
Remove nullmodem().
It may be useful to have a null modem routine, but nullmodem()
wasn't one. nullmodem() was identical to ttymodem() except it
didn't implement MDMBUF (carrier) flow control, didn't do any
wakeups for off to on carrier transitions, and didn't flush the
i/o queues for on to off carrier transitions (flushing has the side
effect of waking up readers and writers) although it did generate
SIGHUPs. The wakeups must normally be done even if nullmodem() is
null in case something is sleeping waiting for a carrier transition.
In any case, the wakeups should be harmless. They may cause bogus
results for select(), but select() is already bogus for nonstandard
line disciplines.
Kernel PPP doesn't pay attention to IPTOS_LOWDELAY, but uses
a table of port numbers, which isn't a generic method. The following
patch fixes this (the table is still used, but in addition
PPP queues the packet in fastq if IPTOS_LOWDELAY is set.
Obtained from: Tatu Ylonen <ylo@cs.hut.fi>
Submitted by: Heikki Suonsivu <hsu@clinet.fi>
assigning an address to an interface automatically marks this
interface IFF_UP. The fix corrects this (and closes PR sys/577).
This is consistent with the way ethernet interfaces are being handled.
should be completely ignored for point-to-point interfaces).
For point-to-point interfaces, route based on the destination address,
not the local address.
Submitted by: Peter Wemm
SLIP device.
2) Don't directly frob the IFF_UP flag - use if_up/if_down as it was
intended.
3) Return ENETDOWN if IFF_UP isn't set when outputing, drop the packet if
if IFF_UP isn't set when inputing.
for broadcasts if point-to-point links shared the same IP address as
the ethernet. The fix must be enabled with P2P_LOCALADDR_SHARE option
in the kernel config file. This will someday likely be standard, but
there isn't sufficient time before release to determine if there are
any interoperability problems with routed and/or gated.
Reviewed by: Garrett Wollman, and me
Submitted by: Peter Wemm
there may even be LKMs.) Also, change the internal name of `unixdomain'
to `localdomain' since AF_LOCAL is now the preferred name of this family.
Declare netisr correctly and in the right place.
This submission was done by hand-applying FreeBSD local modifications on
top of the UCB code, rather than trying to patch the UCB code in on top
of the FreeBSD code due to the extensive changes.
Reviewed by: pst (been handling 30k routes for 4+ months)
Obtained from: Sklower/Woody/Honing/Traina (8.4 UCB release)
go away whenever a clone's parent is changed, or a route is added in a
certain set of circumstances.
This also includes code to forbid setting a route's gateway to an
address which can only be reached through that route, thus (hopefully)
eliminating one class of cloning bottomless-recursion bugs.
so that these ioctls can be handled by the calling layer(s).
Clean up the recently added code:
- include the appropriate header to declare an implicitly declared function.
- declare timeout functions correctly and remove numerous bogus casts that
hid (but didn't fix) their incorrectness.
In rare cases, when the filter specified accesses an multi-byte value that
is split across mbuf's, the value loaded is incorrect. And if you are very
unlucky (like me) it will index off the end of the mbuf and into an
unallocated page and panic the system.
If you look at the code you will discover the the index *k* is added to
the pointer *cp* and the used AGAIN as a subscript.
It is common case when modem hangs with carier on but don't
receive anything from another side.
This thing commonly healed with hangup and redialing.
Enhancements below allows to determine when such action
is needed and inform attach program with SIGURG signal.
There two ioctls set: outfill and keepalive, used from both
sides of connection. Outfill repeatedly sends FRAME_END with
specified timeout (i.e. 40 seconds). It is needed to get input on
other side even if no user activity on slip line currently.
Keepalive checks FRAME_ENDs from other side, and if no one
got in specified timeout (i.e. 60 seconds, max modem retrain time),
send SIGURG to attach program.
I plan to add code to slattach to handle this thing too.
Reviewed by: wollman