Return to BSD News archive
Path: sserve!newshost.anu.edu.au!dubhe.anu.edu.au!sirius.anu.edu.au!not-for-mail
From: paulus@cs.anu.edu.au (Paul Mackerras)
Newsgroups: comp.os.386bsd.questions
Subject: Re: will PPPD go through a pty?
Date: 5 Jul 1994 09:41:59 +1000
Organization: Department of Computer Science, Australian National University
Lines: 115
Message-ID: <2va6o7INN5ld@sirius.anu.edu.au>
References: <Cs9uHD.G80@ns1.nodak.edu>
NNTP-Posting-Host: sirius.anu.edu.au
axvig@plains.NoDak.edu () writes:
>Hi, when a friend tries to establish a PPP connection to
>my computer (he's got Linux + PPP, me FreeBSD 1.1R) I get these
>messages:
>> Jul 1 10:42:20 Osmeh pppd[407]: warning... not a process group leader
>> Jul 1 10:42:20 Osmeh pppd[407]: ioctl(TIOCSCTTY): Invalid argument
>Could it be because topology is somewhat like:
>Linux_host(valid chat script)->My_gateway(rlogin -8...)->my host(of course ttyp?)
[netstat output omitted]
>Can anyone tell me where we are going wrong? Is it even possible
>to make it go through a pseudo terminal?
On BSD systems such as FreeBSD, 386BSD, etc., the pseudo-tty code
won't let a pty be set to any line discipline other than the normal
discipline. So you can't run pppd over a pty. The reason for this
restriction is that ptys can be set into a "remote" mode where the pty
code puts data directly into the canonical queue. I have a patch,
included below, which changes the pty code so that the restriction is
only applied when the pty is in remote mode. If you patch
/sys/kern/tty_pty.c with this patch and recompile your kernel, you
should then be able to run pppd over a pty.
Another point: when you run pppd over an rlogin session, you need to
tell the pppd on the "client" end of the rlogin to escape 0xff on
transmission.
Paul Mackerras paulus@cs.anu.edu.au
Dept. of Computer Science
Australian National University
---------------------------------------------------------------------------
*** tty_pty.c.orig Fri Jul 1 11:50:54 1994
--- tty_pty.c Fri Jul 1 11:51:42 1994
***************
*** 632,640 ****
return (0);
case TIOCREMOTE:
! if (*(int *)data)
pti->pt_flags |= PF_REMOTE;
! else
pti->pt_flags &= ~PF_REMOTE;
ttyflush(tp, FREAD|FWRITE);
return (0);
--- 632,653 ----
return (0);
case TIOCREMOTE:
! if (*(int *)data) {
pti->pt_flags |= PF_REMOTE;
! /*
! * Since we use the tty queues internally
! * when PF_REMOTE is set, we have to
! * switch back to TTYDISC, since we don't
! * know what other disciplines do.
! */
! if (linesw[tp->t_line].l_rint != ttyinput) {
! (*linesw[tp->t_line].l_close)
! (tp, flag);
! tp->t_line = TTYDISC;
! (void)(*linesw[tp->t_line].l_open)
! (dev, tp, flag);
! }
! } else
pti->pt_flags &= ~PF_REMOTE;
ttyflush(tp, FREAD|FWRITE);
return (0);
***************
*** 663,684 ****
ttyinfo(tp);
return(0);
}
! error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag);
! if (error >= 0)
! return (error);
! error = ttioctl(tp, cmd, data, flag);
/*
! * Since we use the tty queues internally,
! * pty's can't be switched to disciplines which overwrite
! * the queues. We can't tell anything about the discipline
! * from here...
*/
! if (linesw[tp->t_line].l_rint != ttyinput) {
! (*linesw[tp->t_line].l_close)(tp, flag);
! tp->t_line = TTYDISC;
! (void)(*linesw[tp->t_line].l_open)(dev, tp, flag);
! error = ENOTTY;
! }
if (error < 0) {
if (pti->pt_flags & PF_UCNTL &&
(cmd & ~0xff) == UIOCCMD(0)) {
--- 676,693 ----
ttyinfo(tp);
return(0);
}
!
/*
! * When PF_REMOTE is set, we don't allow the
! * discipline to be set to anything except TTYDISC.
*/
! if (cmd == TIOCSETD && (pti->pt_flags & PF_REMOTE)
! && *(int *)data != TTYDISC)
! return EINVAL;
!
! error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag);
! if (error < 0)
! error = ttioctl(tp, cmd, data, flag);
if (error < 0) {
if (pti->pt_flags & PF_UCNTL &&
(cmd & ~0xff) == UIOCCMD(0)) {