summaryrefslogtreecommitdiffstats
path: root/sys/net/ppp_tty.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-06-26 08:44:04 +0000
committerphk <phk@FreeBSD.org>2004-06-26 08:44:04 +0000
commit1aa6c5a754b178a4700e8508f2e7a2f5136fd9b6 (patch)
tree04c3b44b676c0a500305ae7636bab0655dde9123 /sys/net/ppp_tty.c
parent772718717b358bd1045f527cb6842b45a4838f18 (diff)
downloadFreeBSD-src-1aa6c5a754b178a4700e8508f2e7a2f5136fd9b6.zip
FreeBSD-src-1aa6c5a754b178a4700e8508f2e7a2f5136fd9b6.tar.gz
Fix line discipline switching issues: If opening a new ldisc fails,
we have to revert to TTYDISC which we know will successfully open rather than try the previous ldisc which might also fail to open. Do not let ldisc implementations muck about with ->t_line, and remove code which checks for reopens, it should never happen. Move ldisc->l_hotchar to tty->t_hotchar and have ldisc implementation initialize it in their open routines. Reset to zero when we enter TTYDISC. ("no" should really be -1 since zero could be a valid hotchar for certain old european mainframe protocols.)
Diffstat (limited to 'sys/net/ppp_tty.c')
-rw-r--r--sys/net/ppp_tty.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c
index 0270acb..05ffb16 100644
--- a/sys/net/ppp_tty.c
+++ b/sys/net/ppp_tty.c
@@ -148,8 +148,7 @@ void pppasyncdetach(void);
static struct linesw pppdisc = {
pppopen, pppclose, pppread, pppwrite,
- ppptioctl, pppinput, pppstart, ttymodem,
- PPP_FLAG
+ ppptioctl, pppinput, pppstart, ttymodem
};
void
@@ -185,13 +184,7 @@ pppopen(dev, tp)
s = spltty();
- if (tp->t_line == PPPDISC) {
- sc = (struct ppp_softc *) tp->t_sc;
- if (sc != NULL && sc->sc_devp == (void *) tp) {
- splx(s);
- return (0);
- }
- }
+ tp->t_hotchar = PPP_FLAG;
if ((sc = pppalloc(td->td_proc->p_pid)) == NULL) {
splx(s);
@@ -254,7 +247,6 @@ pppclose(tp, flag)
ttyflush(tp, FREAD | FWRITE);
clist_free_cblocks(&tp->t_canq);
clist_free_cblocks(&tp->t_outq);
- tp->t_line = 0;
sc = (struct ppp_softc *) tp->t_sc;
if (sc != NULL) {
tp->t_sc = NULL;
OpenPOWER on IntegriCloud