X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=modules%2Fppp.c;h=d033f6e173196303a70f4821809df1986e27b7cb;hb=5755b0122ae26624b5f8bab08851014ba5a4770d;hp=10a5aec2995c785f5db6f487f6d5cbe283129e28;hpb=f268159fb65fd530067226d60a97cbb131a73762;p=ppp.git diff --git a/modules/ppp.c b/modules/ppp.c index 10a5aec..d033f6e 100644 --- a/modules/ppp.c +++ b/modules/ppp.c @@ -24,7 +24,7 @@ * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, * OR MODIFICATIONS. * - * $Id: ppp.c,v 1.19 1999/05/13 00:32:42 paulus Exp $ + * $Id: ppp.c,v 1.21 1999/09/15 23:49:05 masputra Exp $ */ /* @@ -255,7 +255,9 @@ static upperstr_t *find_dest __P((upperstr_t *, int)); static int putctl2 __P((queue_t *, int, int, int)); static int putctl4 __P((queue_t *, int, int, int)); static int pass_packet __P((upperstr_t *ppa, mblk_t *mp, int outbound)); +#ifdef FILTER_PACKETS static int ip_hard_filter __P((upperstr_t *ppa, mblk_t *mp, int outbound)); +#endif /* FILTER_PACKETS */ #define PPP_ID 0xb1a6 static struct module_info ppp_info = { @@ -556,7 +558,7 @@ pppuwput(q, mp) queue_t *q; mblk_t *mp; { - upperstr_t *us, *usnext, *ppa, *os, *nps; + upperstr_t *us, *ppa, *nps; struct iocblk *iop; struct linkblk *lb; #ifdef LACHTCP @@ -567,7 +569,6 @@ pppuwput(q, mp) int error, n, sap; mblk_t *mq; struct ppp_idle *pip; - int len; #ifdef PRIOQ queue_t *tlq; #endif /* PRIOQ */ @@ -1042,7 +1043,7 @@ dlpi_request(q, mp, us) int size = mp->b_wptr - mp->b_rptr; mblk_t *reply, *np; upperstr_t *ppa, *os; - int sap, *ip, len; + int sap, len; dl_info_ack_t *info; dl_bind_ack_t *ackp; @@ -1129,6 +1130,18 @@ dlpi_request(q, mp, us) except that we accept ETHERTYPE_IP in place of PPP_IP. */ sap = d->bind_req.dl_sap; us->req_sap = sap; + +#ifdef SOL2 + /* + * ip will send a sap value of 0 (post-Solaris 7), or + * ETHERTYPE_IP (0x800) (pre-Solaris 8) due to how the + * ppp DLPI provider declares its characteristics. + * + */ + if (sap == 0) + sap = ETHERTYPE_IP; +#endif /* SOL2 */ + if (sap == ETHERTYPE_IP) sap = PPP_IP; if (sap < 0x21 || sap > 0x3fff || (sap & 0x101) != 1) { @@ -1423,7 +1436,6 @@ send_data(mp, us) mblk_t *mp; upperstr_t *us; { - queue_t *q; upperstr_t *ppa; if ((us->flags & US_BLOCKED) || us->npmode == NPMODE_QUEUE) @@ -1435,7 +1447,7 @@ send_data(mp, us) freemsg(mp); return 1; } - if ((q = ppa->lowerq) == 0) { + if (ppa->lowerq == 0) { /* try to send it up the control stream */ if (bcanputnext(ppa->q, mp->b_band)) { /* @@ -1699,9 +1711,7 @@ pppurput(q, mp) mblk_t *mp; { upperstr_t *ppa, *us; - queue_t *uq; int proto, len; - mblk_t *np; struct iocblk *iop; ppa = (upperstr_t *) q->q_ptr;