From: Paul Mackerras Date: Wed, 30 Apr 1997 05:52:59 +0000 (+0000) Subject: minor fixes X-Git-Tag: RELEASE_2_3_6~201 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=2305ca29c0b59dae6edf23b1d69823013999883a minor fixes --- diff --git a/pppd/auth.c b/pppd/auth.c index 5bc3943..1532a74 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -33,7 +33,7 @@ */ #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 @@ -51,14 +51,6 @@ static char rcsid[] = "$Id: auth.c,v 1.30 1997/03/04 03:37:21 paulus Exp $"; #include #include -#if defined(SVR4) || defined(_linux_) -#include -#else -#if defined(SUNOS4) || defined(ULTRIX) -extern char *crypt(); -#endif -#endif - #ifdef USE_PAM #include #include @@ -66,7 +58,9 @@ extern char *crypt(); #ifdef HAS_SHADOW #include +#ifndef SVR4 #include +#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 +extern char *crypt __P((const char *, const char *)); + /* 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)); @@ -463,7 +459,7 @@ np_finished(unit, proto) */ static void check_idle(arg) - caddr_t arg; + void *arg; { struct ppp_idle idle; time_t itime; @@ -486,7 +482,7 @@ check_idle(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 */ @@ -544,9 +540,9 @@ auth_check_options() 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); @@ -762,7 +758,6 @@ login(user, passwd, msg, msglen) #else /* #ifdef USE_PAM */ struct passwd *pw; - char *epasswd; #ifdef HAS_SHADOW struct spwd *spwd; @@ -1135,7 +1130,7 @@ ip_addr_check(addr, addrs) 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); diff --git a/pppd/cbcp.c b/pppd/cbcp.c index 9405f7b..c9ef089 100644 --- a/pppd/cbcp.c +++ b/pppd/cbcp.c @@ -19,7 +19,7 @@ */ #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 @@ -68,11 +68,11 @@ cbcp_state cbcp[NUM_PPP]; /* 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 @@ -189,9 +189,7 @@ cbcp_printpkt(p, plen, printer, arg) 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; @@ -360,7 +358,7 @@ cbcp_resp(us) 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; } } @@ -428,5 +426,5 @@ cbcp_up(us) cbcp_state *us; { persist = 0; - lcp_close(0); + lcp_close(0, "Call me back, please"); } diff --git a/pppd/ccp.c b/pppd/ccp.c index bced7ca..50cb92a 100644 --- a/pppd/ccp.c +++ b/pppd/ccp.c @@ -26,7 +26,7 @@ */ #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 @@ -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_rack_timeout __P(()); +static void ccp_rack_timeout __P((void *)); 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); - UNTIMEOUT(ccp_rack_timeout, (caddr_t) f); + UNTIMEOUT(ccp_rack_timeout, f); } break; @@ -772,7 +772,7 @@ ccp_reqci(f, p, lenp, dont_nak) 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; @@ -869,7 +869,7 @@ ccp_down(f) 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); } @@ -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); - 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; @@ -1030,13 +1030,13 @@ ccp_datainput(unit, pkt, len) */ 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); - 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; diff --git a/pppd/ipcp.c b/pppd/ipcp.c index 5752dd6..d7da001 100644 --- a/pppd/ipcp.c +++ b/pppd/ipcp.c @@ -18,7 +18,7 @@ */ #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 /* @@ -604,7 +604,7 @@ ipcp_nakci(f, p, len) 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; @@ -1269,8 +1269,6 @@ static void 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); diff --git a/pppd/lcp.c b/pppd/lcp.c index 6661b2e..48c1b51 100644 --- a/pppd/lcp.c +++ b/pppd/lcp.c @@ -18,7 +18,7 @@ */ #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 /* @@ -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 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 LcpEchoCheck __P((fsm *)); 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: - 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); @@ -924,7 +925,7 @@ lcp_nakci(f, p, len) 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; @@ -1566,7 +1567,6 @@ lcp_printpkt(p, plen, printer, arg) u_char *pstart, *optend; u_short cishort; u_int32_t cilong; - int fascii; if (plen < HEADERLEN) return 0; @@ -1747,7 +1747,7 @@ LcpEchoCheck (f) * 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; } @@ -1757,7 +1757,7 @@ LcpEchoCheck (f) static void LcpEchoTimeout (arg) - caddr_t arg; + void *arg; { 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) { - UNTIMEOUT (LcpEchoTimeout, (caddr_t) f); + UNTIMEOUT (LcpEchoTimeout, f); lcp_echo_timer_running = 0; } }