aboutsummaryrefslogtreecommitdiff
path: root/sys/net/ppp_tty.c
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2004-06-26 08:44:04 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2004-06-26 08:44:04 +0000
commit4776c074260ab7883d22d32f70147c5304feba43 (patch)
tree04c3b44b676c0a500305ae7636bab0655dde9123 /sys/net/ppp_tty.c
parentb53dd31ab95f80c2beb5da7ddcca1e872f4838ce (diff)
downloadsrc-4776c074260ab7883d22d32f70147c5304feba43.tar.gz
src-4776c074260ab7883d22d32f70147c5304feba43.zip
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.)
Notes
Notes: svn path=/head/; revision=131130
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 0270acbb95bf..05ffb169ab6d 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;