*BSD News Article 22598


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!dubhe.anu.edu.au!sirius!paulus
From: paulus@anu.edu.au (Paul Mackerras)
Newsgroups: comp.os.386bsd.questions
Subject: Re: PPP setup question on FreeBSD
Date: 20 Oct 1993 02:53:47 GMT
Organization: Computer Science Department, ANU, Australia
Lines: 137
Distribution: world
Message-ID: <2a297rINN59a@dubhe.anu.edu.au>
References: <2a102g$ibb@alva.ge.com>
Reply-To: paulus@anu.edu.au
NNTP-Posting-Host: sirius.anu.edu.au

In article ibb@alva.ge.com, steve@combs.salem.ge.com (Stephen F. Combs) writes:
>
> Does anyone have any documentation on how to setup PPP for FreeBSD??  I'm trying
> to connect to my Sun at work and I've got dp-2.3 running on the Sun but can't seem
> to figure out how to make the PPP on FreeBSD (FreeBSD-1.0-EPSILON, upgraded from
> FreeBSD-1.0-GAMMA) work?
> 

Documentation: all there is is what comes in ppp-1.3.tar.Z, obtainable from
dcssoft.anu.edu.au:/pub/paulus, if nowhere else.

Some hints: you need to have a pppd running at both ends of the serial line.
If you set up dp-2.3, I expect it will sit there waiting for either (a) an
attempt to send a packet from the Sun, or (b) a connection request from the
remote pppd.  To start it up as in (a), do something like

	pppd <device> <speed> <options>

where <device> is your serial line to the Sun, <speed> is the speed you want
it to run at, and <options> can include the following if desired:

	mru 296			limit packets to 296 bytes - I recommend this
	asyncmap a0000		avoid sending ^S and ^Q on the serial line

In case (a) you need to add the `passive' option so pppd will just hang
around waiting for the other end to initiate a connection.  In either case,
the pppd on FreeBSD will exit after one ppp connection is initiated and
terminated, so if dp times out and disconnects, you'll have to run pppd
on the NetBSD end again.

There have been some recent changes to if_ppp.c and pppd - they are included
below, check your sources against them.

Paul Mackerras		paulus@cs.anu.edu.au
Dept. of Computer Science
Australian National University.

-----------------------------------------------------------------------------------
*** 1.22	1993/08/31 23:20:40
--- if_ppp.c	1993/10/07 00:25:41
***************
*** 669,676 ****
  	goto bad;
      }
      IF_ENQUEUE(ifq, m0);
!     if (CCOUNT(&sc->sc_ttyp->t_outq) == 0)
! 	pppstart(sc->sc_ttyp);
      splx(s);
      return (0);
  
--- 669,681 ----
  	goto bad;
      }
      IF_ENQUEUE(ifq, m0);
!     /*
!      * The next statement used to be subject to:
!      *     if (CCOUNT(&sc->sc_ttyp->t_outq) == 0)
!      * which was removed so that we don't hang up completely
!      * if the serial transmitter loses an interrupt.
!      */
!     pppstart(sc->sc_ttyp);
      splx(s);
      return (0);
  
***************
*** 825,840 ****
  		    ndone = n - b_to_q(start, n, &tp->t_outq);
  #else
  #ifdef	NetBSD
! 		    /* NetBSD, 0.8 or earlier */
  		    ndone = rb_cwrite(&tp->t_out, start, n);
  #else
! 		    /* 386BSD */
  		    int cc, nleft;
  		    for (nleft = n; nleft > 0; nleft -= cc) {
  			if ((cc = RB_CONTIGPUT(&tp->t_out)) == 0)
  			    break;
  			cc = min (cc, nleft);
! 			bcopy((char *)start, tp->t_out.rb_tl, cc);
  			tp->t_out.rb_tl = RB_ROLLOVER(&tp->t_out,
  						      tp->t_out.rb_tl + cc);
  		    }
--- 830,845 ----
  		    ndone = n - b_to_q(start, n, &tp->t_outq);
  #else
  #ifdef	NetBSD
! 		    /* NetBSD with 2-byte ring buffer entries */
  		    ndone = rb_cwrite(&tp->t_out, start, n);
  #else
! 		    /* 386BSD, FreeBSD */
  		    int cc, nleft;
  		    for (nleft = n; nleft > 0; nleft -= cc) {
  			if ((cc = RB_CONTIGPUT(&tp->t_out)) == 0)
  			    break;
  			cc = min (cc, nleft);
! 			bcopy((char *)start + n - nleft, tp->t_out.rb_tl, cc);
  			tp->t_out.rb_tl = RB_ROLLOVER(&tp->t_out,
  						      tp->t_out.rb_tl + cc);
  		    }

===================================================================
RCS file: /a/cvs/386BSD/src/libexec/pppd/main.c,v
retrieving revision 1.2
diff -c -r1.2 main.c
*** 1.2	1993/09/06 20:41:38
--- main.c	1993/10/07 08:02:35
***************
*** 161,167 ****
  static char user[80];		/* User name */
  static char passwd[80];		/* password */
  static char *connector = NULL;	/* "connect" command */
! static char inspeed = 0;	/* Input/Output speed */
  static u_long netmask = 0;	/* netmask to use on ppp interface */
  static int crtscts = 0;		/* use h/w flow control */
  static int nodetach = 0;	/* don't fork */
--- 161,167 ----
  static char user[80];		/* User name */
  static char passwd[80];		/* password */
  static char *connector = NULL;	/* "connect" command */
! static int inspeed = 0;		/* Input/Output speed */
  static u_long netmask = 0;	/* netmask to use on ppp interface */
  static int crtscts = 0;		/* use h/w flow control */
  static int nodetach = 0;	/* don't fork */
***************
*** 747,752 ****
--- 747,756 ----
      tios.c_cc[VERASE] = tios.c_cc[VKILL] = 0;
      tios.c_cc[VMIN] = 1;
      tios.c_cc[VTIME] = 0;
+     if (inspeed) {
+         tios.c_ispeed = inspeed;
+         tios.c_ospeed = inspeed;
+     }
  
      if (ioctl(fd, TIOCSETA, &tios) < 0) {
  	syslog(LOG_ERR, "ioctl(TIOCSETA): %m");