]> git.ozlabs.org Git - ppp.git/commitdiff
Some mods from Bruce Evans
authorPaul Mackerras <paulus@samba.org>
Wed, 16 Aug 1995 01:36:40 +0000 (01:36 +0000)
committerPaul Mackerras <paulus@samba.org>
Wed, 16 Aug 1995 01:36:40 +0000 (01:36 +0000)
freebsd-2.0/if_ppp.c
freebsd-2.0/ppp_tty.c

index f6f4e84ce99df7a365e0204d0b03d00ad7e723a5..d62251aa5dba80ef5dc9fd3fb3f3dbea5eaec5c8 100644 (file)
@@ -69,7 +69,7 @@
  * Paul Mackerras (paulus@cs.anu.edu.au).
  */
 
  * Paul Mackerras (paulus@cs.anu.edu.au).
  */
 
-/* $Id: if_ppp.c,v 1.4 1995/07/11 06:37:41 paulus Exp $ */
+/* $Id: if_ppp.c,v 1.5 1995/08/16 01:36:38 paulus Exp $ */
 /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */
 
 #include "ppp.h"
 /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */
 
 #include "ppp.h"
@@ -191,7 +191,7 @@ pppattach()
        sc->sc_if.if_name = "ppp";
        sc->sc_if.if_unit = i++;
        sc->sc_if.if_mtu = PPP_MTU;
        sc->sc_if.if_name = "ppp";
        sc->sc_if.if_unit = i++;
        sc->sc_if.if_mtu = PPP_MTU;
-       sc->sc_if.if_flags = IFF_POINTOPOINT;
+       sc->sc_if.if_flags = IFF_POINTOPOINT | IFF_MULTICAST;
        sc->sc_if.if_type = IFT_PPP;
        sc->sc_if.if_hdrlen = PPP_HDRLEN;
        sc->sc_if.if_ioctl = pppsioctl;
        sc->sc_if.if_type = IFT_PPP;
        sc->sc_if.if_hdrlen = PPP_HDRLEN;
        sc->sc_if.if_ioctl = pppsioctl;
@@ -511,6 +511,19 @@ pppsioctl(ifp, cmd, data)
        ifr->ifr_mtu = sc->sc_if.if_mtu;
        break;
 
        ifr->ifr_mtu = sc->sc_if.if_mtu;
        break;
 
+    case SIOCADDMULTI:
+    case SIOCDELMULTI:
+       switch(ifr->ifr_addr.sa_family) {
+#ifdef INET
+       case AF_INET:
+           break;
+#endif
+       default:
+           error = EAFNOSUPPORT;
+           break;
+       }
+       break;
+
     case SIOCGPPPSTATS:
        psp = &((struct ifpppstatsreq *) data)->stats;
        bzero(psp, sizeof(*psp));
     case SIOCGPPPSTATS:
        psp = &((struct ifpppstatsreq *) data)->stats;
        bzero(psp, sizeof(*psp));
index 1f22821dc26f58b4b1398b3508fefd6b130748cc..5ad17d22572a8d75f0bd72b362c028db643ca410 100644 (file)
@@ -70,7 +70,7 @@
  * Paul Mackerras (paulus@cs.anu.edu.au).
  */
 
  * Paul Mackerras (paulus@cs.anu.edu.au).
  */
 
-/* $Id: ppp_tty.c,v 1.2 1995/05/02 01:00:44 paulus Exp $ */
+/* $Id: ppp_tty.c,v 1.3 1995/08/16 01:36:40 paulus Exp $ */
 /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */
 
 #include "ppp.h"
 /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */
 
 #include "ppp.h"
@@ -157,7 +157,7 @@ static void ppplogchar __P((struct ppp_softc *, int));
 
 static struct linesw pppdisc = {
        pppopen, pppclose, pppread, pppwrite, ppptioctl,
 
 static struct linesw pppdisc = {
        pppopen, pppclose, pppread, pppwrite, ppptioctl,
-       pppinput, pppstart, nullmodem
+       pppinput, pppstart, ttymodem
 };
 
 void
 };
 
 void
@@ -301,8 +301,7 @@ pppread(tp, uio, flag)
        }
        if (sc->sc_inq.ifq_head != NULL)
            break;
        }
        if (sc->sc_inq.ifq_head != NULL)
            break;
-       if ((tp->t_state & TS_CARR_ON) == 0 && (tp->t_cflag & CLOCAL) == 0
-           && (tp->t_state & TS_ISOPEN)) {
+       if ((tp->t_state & TS_CONNECTED) == 0 && (tp->t_state & TS_ISOPEN)) {
            splx(s);
            return 0;           /* end of file */
        }
            splx(s);
            return 0;           /* end of file */
        }
@@ -310,7 +309,7 @@ pppread(tp, uio, flag)
            splx(s);
            return (EWOULDBLOCK);
        }
            splx(s);
            return (EWOULDBLOCK);
        }
-       error = ttysleep(tp, (caddr_t)&tp->t_rawq, TTIPRI|PCATCH, ttyin, 0);
+       error = ttysleep(tp, TSA_HUP_OR_INPUT(tp), TTIPRI | PCATCH, "pppin", 0);
        if (error) {
            splx(s);
            return error;
        if (error) {
            splx(s);
            return error;
@@ -345,7 +344,7 @@ pppwrite(tp, uio, flag)
     struct sockaddr dst;
     int len, error;
 
     struct sockaddr dst;
     int len, error;
 
-    if ((tp->t_state & TS_CARR_ON) == 0 && (tp->t_cflag & CLOCAL) == 0)
+    if ((tp->t_state & TS_CONNECTED) == 0)
        return 0;               /* wrote 0 bytes */
     if (tp->t_line != PPPDISC)
        return (EINVAL);
        return 0;               /* wrote 0 bytes */
     if (tp->t_line != PPPDISC)
        return (EINVAL);
@@ -543,7 +542,7 @@ pppstart(tp)
     int n, s, ndone, done, idle;
     struct mbuf *m2;
 
     int n, s, ndone, done, idle;
     struct mbuf *m2;
 
-    if ((tp->t_state & TS_CARR_ON) == 0 && (tp->t_cflag & CLOCAL) == 0
+    if ((tp->t_state & TS_CONNECTED) == 0
        || sc == NULL || tp != (struct tty *) sc->sc_devp) {
        if (tp->t_oproc != NULL)
            (*tp->t_oproc)(tp);
        || sc == NULL || tp != (struct tty *) sc->sc_devp) {
        if (tp->t_oproc != NULL)
            (*tp->t_oproc)(tp);
@@ -695,7 +694,7 @@ pppstart(tp)
     }
 
     /*
     }
 
     /*
-     * If there is stuff in the output queue, send it now.
+     * Send anything that may be in the output queue.
      * We are being called in lieu of ttstart and must do what it would.
      */
     if (tp->t_oproc != NULL)
      * We are being called in lieu of ttstart and must do what it would.
      */
     if (tp->t_oproc != NULL)