]> git.ozlabs.org Git - ppp.git/commitdiff
minor fixes
authorPaul Mackerras <paulus@samba.org>
Wed, 30 Apr 1997 05:52:59 +0000 (05:52 +0000)
committerPaul Mackerras <paulus@samba.org>
Wed, 30 Apr 1997 05:52:59 +0000 (05:52 +0000)
pppd/auth.c
pppd/cbcp.c
pppd/ccp.c
pppd/ipcp.c
pppd/lcp.c

index 5bc3943ec50ad862183ebaf4d82ad5a0c8fbf68b..1532a74762491db5185519515e61eac8cd7c7246 100644 (file)
@@ -33,7 +33,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: auth.c,v 1.30 1997/03/04 03:37:21 paulus Exp $";
+static char rcsid[] = "$Id: auth.c,v 1.31 1997/04/30 05:50:16 paulus Exp $";
 #endif
 
 #include <stdio.h>
 #endif
 
 #include <stdio.h>
@@ -51,14 +51,6 @@ static char rcsid[] = "$Id: auth.c,v 1.30 1997/03/04 03:37:21 paulus Exp $";
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
-#if defined(SVR4) || defined(_linux_)
-#include <crypt.h>
-#else
-#if defined(SUNOS4) || defined(ULTRIX)
-extern char *crypt();
-#endif
-#endif
-
 #ifdef USE_PAM
 #include <security/pam_appl.h>
 #include <security/pam_modules.h>
 #ifdef USE_PAM
 #include <security/pam_appl.h>
 #include <security/pam_modules.h>
@@ -66,7 +58,9 @@ extern char *crypt();
 
 #ifdef HAS_SHADOW
 #include <shadow.h>
 
 #ifdef HAS_SHADOW
 #include <shadow.h>
+#ifndef SVR4
 #include <shadow/pwauth.h>
 #include <shadow/pwauth.h>
+#endif
 #ifndef PW_PPP
 #define PW_PPP PW_LOGIN
 #endif
 #ifndef PW_PPP
 #define PW_PPP PW_LOGIN
 #endif
@@ -128,11 +122,13 @@ static int passwd_from_file;
 #define CHAP_WITHPEER  4
 #define CHAP_PEER      8
 
 #define CHAP_WITHPEER  4
 #define CHAP_PEER      8
 
+extern char *crypt __P((const char *, const char *));
+
 /* Prototypes for procedures local to this file. */
 
 static void network_phase __P((int));
 /* Prototypes for procedures local to this file. */
 
 static void network_phase __P((int));
-static void check_idle __P((caddr_t));
-static void connect_time_expired __P((caddr_t));
+static void check_idle __P((void *));
+static void connect_time_expired __P((void *));
 static int  login __P((char *, char *, char **, int *));
 static void logout __P((void));
 static int  null_login __P((int));
 static int  login __P((char *, char *, char **, int *));
 static void logout __P((void));
 static int  null_login __P((int));
@@ -463,7 +459,7 @@ np_finished(unit, proto)
  */
 static void
 check_idle(arg)
  */
 static void
 check_idle(arg)
-    caddr_t arg;
+     void *arg;
 {
     struct ppp_idle idle;
     time_t itime;
 {
     struct ppp_idle idle;
     time_t itime;
@@ -486,7 +482,7 @@ check_idle(arg)
  */
 static void
 connect_time_expired(arg)
  */
 static void
 connect_time_expired(arg)
-    caddr_t arg;
+    void *arg;
 {
     syslog(LOG_INFO, "Connect time expired");
     lcp_close(0, "Connect time expired");      /* Close connection */
 {
     syslog(LOG_INFO, "Connect time expired");
     lcp_close(0, "Connect time expired");      /* Close connection */
@@ -544,9 +540,9 @@ auth_check_options()
            option_error("can't override device name when noauth option used");
            exit(1);
        }
            option_error("can't override device name when noauth option used");
            exit(1);
        }
-       if (connector != NULL && connector_info.priv == 0
-           || disconnector != NULL && disconnector_info.priv == 0
-           || welcomer != NULL && welcomer_info.priv == 0) {
+       if ((connector != NULL && connector_info.priv == 0)
+           || (disconnector != NULL && disconnector_info.priv == 0)
+           || (welcomer != NULL && welcomer_info.priv == 0)) {
            option_error("can't override connect, disconnect or welcome");
            option_error("option values when noauth option used");
            exit(1);
            option_error("can't override connect, disconnect or welcome");
            option_error("option values when noauth option used");
            exit(1);
@@ -762,7 +758,6 @@ login(user, passwd, msg, msglen)
 #else /* #ifdef USE_PAM */
 
     struct passwd *pw;
 #else /* #ifdef USE_PAM */
 
     struct passwd *pw;
-    char *epasswd;
 
 #ifdef HAS_SHADOW
     struct spwd *spwd;
 
 #ifdef HAS_SHADOW
     struct spwd *spwd;
@@ -1135,7 +1130,7 @@ ip_addr_check(addr, addrs)
        if (ptr_mask != NULL)
            *ptr_mask = '/';
 
        if (ptr_mask != NULL)
            *ptr_mask = '/';
 
-       if (a == -1L)
+       if (a == (u_int32_t)-1L)
            syslog (LOG_WARNING,
                    "unknown host %s in auth. address list",
                    addrs->word);
            syslog (LOG_WARNING,
                    "unknown host %s in auth. address list",
                    addrs->word);
index 9405f7bfa266a179ceb0860f8a6639c6ce373561..c9ef0899ae9fb500fbfe692f0f1198cce44e1e91 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: cbcp.c,v 1.1 1996/10/08 04:35:41 paulus Exp $";
+static char rcsid[] = "$Id: cbcp.c,v 1.2 1997/04/30 05:50:26 paulus Exp $";
 #endif
 
 #include <stdio.h>
 #endif
 
 #include <stdio.h>
@@ -68,11 +68,11 @@ cbcp_state cbcp[NUM_PPP];
 
 /* internal prototypes */
 
 
 /* internal prototypes */
 
-void cbcp_recvreq(cbcp_state *us, char *pckt, int len);
-void cbcp_resp(cbcp_state *us);
-void cbcp_up(cbcp_state *us);
-void cbcp_recvack(cbcp_state *us, char *pckt, int len);
-void cbcp_send(cbcp_state *us, u_char code, u_char *buf, int len);
+static void cbcp_recvreq __P((cbcp_state *us, char *pckt, int len));
+static void cbcp_resp __P((cbcp_state *us));
+static void cbcp_up __P((cbcp_state *us));
+static void cbcp_recvack __P((cbcp_state *us, char *pckt, int len));
+static void cbcp_send __P((cbcp_state *us, u_char code, u_char *buf, int len));
 
 /* init state */
 static void
 
 /* init state */
 static void
@@ -189,9 +189,7 @@ cbcp_printpkt(p, plen, printer, arg)
     void *arg;
 {
     int code, opt, id, len, olen, delay;
     void *arg;
 {
     int code, opt, id, len, olen, delay;
-    u_char *pstart, *optend;
-    u_short cishort;
-    u_long cilong;
+    u_char *pstart;
 
     if (plen < HEADERLEN)
        return 0;
 
     if (plen < HEADERLEN)
        return 0;
@@ -360,7 +358,7 @@ cbcp_resp(us)
        PUTCHAR(len , bufp);
        PUTCHAR(0, bufp);
        cbcp_send(us, CBCP_RESP, buf, len);
        PUTCHAR(len , bufp);
        PUTCHAR(0, bufp);
        cbcp_send(us, CBCP_RESP, buf, len);
-       ipcp_open(us->us_unit);
+       (*ipcp_protent.open)(us->us_unit);
        return;
     }
 }
        return;
     }
 }
@@ -428,5 +426,5 @@ cbcp_up(us)
     cbcp_state *us;
 {
     persist = 0;
     cbcp_state *us;
 {
     persist = 0;
-    lcp_close(0);
+    lcp_close(0, "Call me back, please");
 }
 }
index bced7ca713c5b782bb84329a4061b89e8fd4ccc9..50cb92ab6e18590453795bc765f23b941048312c 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: ccp.c,v 1.19 1996/09/26 06:20:52 paulus Exp $";
+static char rcsid[] = "$Id: ccp.c,v 1.20 1997/04/30 05:50:40 paulus Exp $";
 #endif
 
 #include <string.h>
 #endif
 
 #include <string.h>
@@ -92,7 +92,7 @@ static int  ccp_reqci __P((fsm *, u_char *, int *, int));
 static void ccp_up __P((fsm *));
 static void ccp_down __P((fsm *));
 static int  ccp_extcode __P((fsm *, int, int, u_char *, int));
 static void ccp_up __P((fsm *));
 static void ccp_down __P((fsm *));
 static int  ccp_extcode __P((fsm *, int, int, u_char *, int));
-static void ccp_rack_timeout __P(());
+static void ccp_rack_timeout __P((void *));
 static char *method_name __P((ccp_options *, ccp_options *));
 
 static fsm_callbacks ccp_callbacks = {
 static char *method_name __P((ccp_options *, ccp_options *));
 
 static fsm_callbacks ccp_callbacks = {
@@ -268,7 +268,7 @@ ccp_extcode(f, code, id, p, len)
     case CCP_RESETACK:
        if (ccp_localstate[f->unit] & RACK_PENDING && id == f->reqid) {
            ccp_localstate[f->unit] &= ~(RACK_PENDING | RREQ_REPEAT);
     case CCP_RESETACK:
        if (ccp_localstate[f->unit] & RACK_PENDING && id == f->reqid) {
            ccp_localstate[f->unit] &= ~(RACK_PENDING | RREQ_REPEAT);
-           UNTIMEOUT(ccp_rack_timeout, (caddr_t) f);
+           UNTIMEOUT(ccp_rack_timeout, f);
        }
        break;
 
        }
        break;
 
@@ -772,7 +772,7 @@ ccp_reqci(f, p, lenp, dont_nak)
 
        if (newret == CONFNAK && dont_nak)
            newret = CONFREJ;
 
        if (newret == CONFNAK && dont_nak)
            newret = CONFREJ;
-       if (!(newret == CONFACK || newret == CONFNAK && ret == CONFREJ)) {
+       if (!(newret == CONFACK || (newret == CONFNAK && ret == CONFREJ))) {
            /* we're returning this option */
            if (newret == CONFREJ && ret == CONFNAK)
                retp = p0;
            /* we're returning this option */
            if (newret == CONFREJ && ret == CONFNAK)
                retp = p0;
@@ -869,7 +869,7 @@ ccp_down(f)
     fsm *f;
 {
     if (ccp_localstate[f->unit] & RACK_PENDING)
     fsm *f;
 {
     if (ccp_localstate[f->unit] & RACK_PENDING)
-       UNTIMEOUT(ccp_rack_timeout, (caddr_t) f);
+       UNTIMEOUT(ccp_rack_timeout, f);
     ccp_localstate[f->unit] = 0;
     ccp_flags_set(f->unit, 1, 0);
 }
     ccp_localstate[f->unit] = 0;
     ccp_flags_set(f->unit, 1, 0);
 }
@@ -1017,7 +1017,7 @@ ccp_datainput(unit, pkt, len)
             */
            if (!(ccp_localstate[f->unit] & RACK_PENDING)) {
                fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0);
             */
            if (!(ccp_localstate[f->unit] & RACK_PENDING)) {
                fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0);
-               TIMEOUT(ccp_rack_timeout, (caddr_t) f, RACKTIMEOUT);
+               TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT);
                ccp_localstate[f->unit] |= RACK_PENDING;
            } else
                ccp_localstate[f->unit] |= RREQ_REPEAT;
                ccp_localstate[f->unit] |= RACK_PENDING;
            } else
                ccp_localstate[f->unit] |= RREQ_REPEAT;
@@ -1030,13 +1030,13 @@ ccp_datainput(unit, pkt, len)
  */
 static void
 ccp_rack_timeout(arg)
  */
 static void
 ccp_rack_timeout(arg)
-    caddr_t arg;
+    void *arg;
 {
 {
-    fsm *f = (fsm *) arg;
+    fsm *f = arg;
 
     if (f->state == OPENED && ccp_localstate[f->unit] & RREQ_REPEAT) {
        fsm_sdata(f, CCP_RESETREQ, f->reqid, NULL, 0);
 
     if (f->state == OPENED && ccp_localstate[f->unit] & RREQ_REPEAT) {
        fsm_sdata(f, CCP_RESETREQ, f->reqid, NULL, 0);
-       TIMEOUT(ccp_rack_timeout, (caddr_t) f, RACKTIMEOUT);
+       TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT);
        ccp_localstate[f->unit] &= ~RREQ_REPEAT;
     } else
        ccp_localstate[f->unit] &= ~RACK_PENDING;
        ccp_localstate[f->unit] &= ~RREQ_REPEAT;
     } else
        ccp_localstate[f->unit] &= ~RACK_PENDING;
index 5752dd66581ad7cc6c4fe52850a51d2a7f8cb38b..d7da0019681bcef501b672523a2f02b3484db055 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: ipcp.c,v 1.30 1997/03/04 03:39:10 paulus Exp $";
+static char rcsid[] = "$Id: ipcp.c,v 1.31 1997/04/30 05:52:48 paulus Exp $";
 #endif
 
 /*
 #endif
 
 /*
@@ -604,7 +604,7 @@ ipcp_nakci(f, p, len)
            no.neg_vj = 1;
            break;
        case CI_ADDRS:
            no.neg_vj = 1;
            break;
        case CI_ADDRS:
-           if (go->neg_addr && go->old_addrs || no.old_addrs
+           if ((go->neg_addr && go->old_addrs) || no.old_addrs
                || cilen != CILEN_ADDRS)
                goto bad;
            try.neg_addr = 1;
                || cilen != CILEN_ADDRS)
                goto bad;
            try.neg_addr = 1;
@@ -1269,8 +1269,6 @@ static void
 ipcp_down(f)
     fsm *f;
 {
 ipcp_down(f)
     fsm *f;
 {
-    u_int32_t ouraddr, hisaddr;
-
     IPCPDEBUG((LOG_INFO, "ipcp: down"));
     np_down(f->unit, PPP_IP);
     sifvjcomp(f->unit, 0, 0, 0);
     IPCPDEBUG((LOG_INFO, "ipcp: down"));
     np_down(f->unit, PPP_IP);
     sifvjcomp(f->unit, 0, 0, 0);
index 6661b2e4c4634c4b9fe1cc41f3ca99a53b1b84e5..48c1b5168b64f687d5e06cc5315b47485b4147ad 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: lcp.c,v 1.29 1997/03/04 03:39:56 paulus Exp $";
+static char rcsid[] = "$Id: lcp.c,v 1.30 1997/04/30 05:52:59 paulus Exp $";
 #endif
 
 /*
 #endif
 
 /*
@@ -78,10 +78,11 @@ static void lcp_rprotrej __P((fsm *, u_char *, int));
 
 static void lcp_echo_lowerup __P((int));
 static void lcp_echo_lowerdown __P((int));
 
 static void lcp_echo_lowerup __P((int));
 static void lcp_echo_lowerdown __P((int));
-static void LcpEchoTimeout __P((caddr_t));
+static void LcpEchoTimeout __P((void *));
 static void lcp_received_echo_reply __P((fsm *, int, u_char *, int));
 static void LcpSendEchoRequest __P((fsm *));
 static void LcpLinkFailure __P((fsm *));
 static void lcp_received_echo_reply __P((fsm *, int, u_char *, int));
 static void LcpSendEchoRequest __P((fsm *));
 static void LcpLinkFailure __P((fsm *));
+static void LcpEchoCheck __P((fsm *));
 
 static fsm_callbacks lcp_callbacks = { /* LCP callback routines */
     lcp_resetci,               /* Reset our Configuration Information */
 
 static fsm_callbacks lcp_callbacks = { /* LCP callback routines */
     lcp_resetci,               /* Reset our Configuration Information */
@@ -916,7 +917,7 @@ lcp_nakci(f, p, len)
 
        switch (citype) {
        case CI_MRU:
 
        switch (citype) {
        case CI_MRU:
-           if (go->neg_mru && go->mru != DEFMRU
+           if ((go->neg_mru && go->mru != DEFMRU)
                || no.neg_mru || cilen != CILEN_SHORT)
                goto bad;
            GETSHORT(cishort, p);
                || no.neg_mru || cilen != CILEN_SHORT)
                goto bad;
            GETSHORT(cishort, p);
@@ -924,7 +925,7 @@ lcp_nakci(f, p, len)
                try.mru = cishort;
            break;
        case CI_ASYNCMAP:
                try.mru = cishort;
            break;
        case CI_ASYNCMAP:
-           if (go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF
+           if ((go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF)
                || no.neg_asyncmap || cilen != CILEN_LONG)
                goto bad;
            break;
                || no.neg_asyncmap || cilen != CILEN_LONG)
                goto bad;
            break;
@@ -1566,7 +1567,6 @@ lcp_printpkt(p, plen, printer, arg)
     u_char *pstart, *optend;
     u_short cishort;
     u_int32_t cilong;
     u_char *pstart, *optend;
     u_short cishort;
     u_int32_t cilong;
-    int fascii;
 
     if (plen < HEADERLEN)
        return 0;
 
     if (plen < HEADERLEN)
        return 0;
@@ -1747,7 +1747,7 @@ LcpEchoCheck (f)
      * Start the timer for the next interval.
      */
     assert (lcp_echo_timer_running==0);
      * Start the timer for the next interval.
      */
     assert (lcp_echo_timer_running==0);
-    TIMEOUT (LcpEchoTimeout, (caddr_t) f, lcp_echo_interval);
+    TIMEOUT (LcpEchoTimeout, f, lcp_echo_interval);
     lcp_echo_timer_running = 1;
 }
 
     lcp_echo_timer_running = 1;
 }
 
@@ -1757,7 +1757,7 @@ LcpEchoCheck (f)
 
 static void
 LcpEchoTimeout (arg)
 
 static void
 LcpEchoTimeout (arg)
-    caddr_t arg;
+    void *arg;
 {
     if (lcp_echo_timer_running != 0) {
         lcp_echo_timer_running = 0;
 {
     if (lcp_echo_timer_running != 0) {
         lcp_echo_timer_running = 0;
@@ -1855,7 +1855,7 @@ lcp_echo_lowerdown (unit)
     fsm *f = &lcp_fsm[unit];
 
     if (lcp_echo_timer_running != 0) {
     fsm *f = &lcp_fsm[unit];
 
     if (lcp_echo_timer_running != 0) {
-        UNTIMEOUT (LcpEchoTimeout, (caddr_t) f);
+        UNTIMEOUT (LcpEchoTimeout, f);
         lcp_echo_timer_running = 0;
     }
 }
         lcp_echo_timer_running = 0;
     }
 }