mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-04-16 08:43:17 +00:00
Added debug output and missing casts
This commit is contained in:
parent
402597c2cb
commit
ea78d69c6d
@ -605,7 +605,7 @@ auth_peer_success(int unit, u16_t protocol, char *name, int namelen)
|
|||||||
/*
|
/*
|
||||||
* Save the authenticated name of the peer for later.
|
* Save the authenticated name of the peer for later.
|
||||||
*/
|
*/
|
||||||
if (namelen > sizeof(peer_authname) - 1) {
|
if (namelen > (int)sizeof(peer_authname) - 1) {
|
||||||
namelen = sizeof(peer_authname) - 1;
|
namelen = sizeof(peer_authname) - 1;
|
||||||
}
|
}
|
||||||
BCOPY(name, peer_authname, namelen);
|
BCOPY(name, peer_authname, namelen);
|
||||||
|
@ -452,7 +452,7 @@ ChapReceiveChallenge(chap_state *cstate, u_char *inp, u_char id, int len)
|
|||||||
rchallenge = inp;
|
rchallenge = inp;
|
||||||
INCPTR(rchallenge_len, inp);
|
INCPTR(rchallenge_len, inp);
|
||||||
|
|
||||||
if (len >= sizeof(rhostname)) {
|
if (len >= (int)sizeof(rhostname)) {
|
||||||
len = sizeof(rhostname) - 1;
|
len = sizeof(rhostname) - 1;
|
||||||
}
|
}
|
||||||
BCOPY(inp, rhostname, len);
|
BCOPY(inp, rhostname, len);
|
||||||
@ -571,7 +571,7 @@ ChapReceiveResponse(chap_state *cstate, u_char *inp, int id, int len)
|
|||||||
|
|
||||||
UNTIMEOUT(ChapChallengeTimeout, cstate);
|
UNTIMEOUT(ChapChallengeTimeout, cstate);
|
||||||
|
|
||||||
if (len >= sizeof(rhostname)) {
|
if (len >= (int)sizeof(rhostname)) {
|
||||||
len = sizeof(rhostname) - 1;
|
len = sizeof(rhostname) - 1;
|
||||||
}
|
}
|
||||||
BCOPY(inp, rhostname, len);
|
BCOPY(inp, rhostname, len);
|
||||||
|
@ -76,8 +76,9 @@ ipcp_options ipcp_allowoptions[NUM_PPP]; /* Options we allow peer to request */
|
|||||||
ipcp_options ipcp_hisoptions[NUM_PPP]; /* Options that we ack'd */
|
ipcp_options ipcp_hisoptions[NUM_PPP]; /* Options that we ack'd */
|
||||||
|
|
||||||
/* local vars */
|
/* local vars */
|
||||||
static int cis_received[NUM_PPP]; /* # Conf-Reqs received */
|
|
||||||
static int default_route_set[NUM_PPP]; /* Have set up a default route */
|
static int default_route_set[NUM_PPP]; /* Have set up a default route */
|
||||||
|
static int cis_received[NUM_PPP]; /* # Conf-Reqs received */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Callbacks for fsm code. (CI = Configuration Information)
|
* Callbacks for fsm code. (CI = Configuration Information)
|
||||||
@ -525,7 +526,7 @@ ipcp_ackci(fsm *f, u_char *p, int len)
|
|||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
return (1);
|
return (1);
|
||||||
|
|
||||||
bad:
|
bad:
|
||||||
IPCPDEBUG((LOG_INFO, "ipcp_ackci: received bad Ack!\n"));
|
IPCPDEBUG((LOG_INFO, "ipcp_ackci: received bad Ack!\n"));
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -242,7 +242,7 @@ lcp_init(int unit)
|
|||||||
fsm *f = &lcp_fsm[unit];
|
fsm *f = &lcp_fsm[unit];
|
||||||
lcp_options *wo = &lcp_wantoptions[unit];
|
lcp_options *wo = &lcp_wantoptions[unit];
|
||||||
lcp_options *ao = &lcp_allowoptions[unit];
|
lcp_options *ao = &lcp_allowoptions[unit];
|
||||||
|
|
||||||
f->unit = unit;
|
f->unit = unit;
|
||||||
f->protocol = PPP_LCP;
|
f->protocol = PPP_LCP;
|
||||||
f->callbacks = &lcp_callbacks;
|
f->callbacks = &lcp_callbacks;
|
||||||
@ -449,7 +449,7 @@ lcp_rprotrej(fsm *f, u_char *inp, int len)
|
|||||||
struct protent *protp;
|
struct protent *protp;
|
||||||
u_short prot;
|
u_short prot;
|
||||||
|
|
||||||
if (len < sizeof (u_short)) {
|
if (len < (int)sizeof (u_short)) {
|
||||||
LCPDEBUG((LOG_INFO, "lcp_rprotrej: Rcvd short Protocol-Reject packet!\n"));
|
LCPDEBUG((LOG_INFO, "lcp_rprotrej: Rcvd short Protocol-Reject packet!\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -218,6 +218,7 @@ upap_timeout(void *arg)
|
|||||||
u->us_unit, u->us_timeouttime, u->us_clientstate));
|
u->us_unit, u->us_timeouttime, u->us_clientstate));
|
||||||
|
|
||||||
if (u->us_clientstate != UPAPCS_AUTHREQ) {
|
if (u->us_clientstate != UPAPCS_AUTHREQ) {
|
||||||
|
UPAPDEBUG((LOG_INFO, "upap_timeout: not in AUTHREQ state!\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,14 +343,14 @@ upap_input(int unit, u_char *inpacket, int l)
|
|||||||
* If packet too short, drop it.
|
* If packet too short, drop it.
|
||||||
*/
|
*/
|
||||||
inp = inpacket;
|
inp = inpacket;
|
||||||
if (l < UPAP_HEADERLEN) {
|
if (l < (int)UPAP_HEADERLEN) {
|
||||||
UPAPDEBUG((LOG_INFO, "pap_input: rcvd short header.\n"));
|
UPAPDEBUG((LOG_INFO, "pap_input: rcvd short header.\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GETCHAR(code, inp);
|
GETCHAR(code, inp);
|
||||||
GETCHAR(id, inp);
|
GETCHAR(id, inp);
|
||||||
GETSHORT(len, inp);
|
GETSHORT(len, inp);
|
||||||
if (len < UPAP_HEADERLEN) {
|
if (len < (int)UPAP_HEADERLEN) {
|
||||||
UPAPDEBUG((LOG_INFO, "pap_input: rcvd illegal length.\n"));
|
UPAPDEBUG((LOG_INFO, "pap_input: rcvd illegal length.\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -376,6 +377,7 @@ upap_input(int unit, u_char *inpacket, int l)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default: /* XXX Need code reject */
|
default: /* XXX Need code reject */
|
||||||
|
UPAPDEBUG((LOG_INFO, "pap_input: UNHANDLED default: code: %d, id: %d, len: %d.\n", code, id, len));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -415,7 +417,7 @@ upap_rauthreq(upap_state *u, u_char *inp, u_char id, int len)
|
|||||||
/*
|
/*
|
||||||
* Parse user/passwd.
|
* Parse user/passwd.
|
||||||
*/
|
*/
|
||||||
if (len < sizeof (u_char)) {
|
if (len < (int)sizeof (u_char)) {
|
||||||
UPAPDEBUG((LOG_INFO, "pap_rauth: rcvd short packet.\n"));
|
UPAPDEBUG((LOG_INFO, "pap_rauth: rcvd short packet.\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -471,13 +473,14 @@ upap_rauthack(upap_state *u, u_char *inp, int id, int len)
|
|||||||
UPAPDEBUG((LOG_INFO, "pap_rauthack: Rcvd id %d s=%d\n", id, u->us_clientstate));
|
UPAPDEBUG((LOG_INFO, "pap_rauthack: Rcvd id %d s=%d\n", id, u->us_clientstate));
|
||||||
|
|
||||||
if (u->us_clientstate != UPAPCS_AUTHREQ) { /* XXX */
|
if (u->us_clientstate != UPAPCS_AUTHREQ) { /* XXX */
|
||||||
|
UPAPDEBUG((LOG_INFO, "pap_rauthack: us_clientstate != UPAPCS_AUTHREQ\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parse message.
|
* Parse message.
|
||||||
*/
|
*/
|
||||||
if (len < sizeof (u_char)) {
|
if (len < (int)sizeof (u_char)) {
|
||||||
UPAPDEBUG((LOG_INFO, "pap_rauthack: ignoring missing msg-length.\n"));
|
UPAPDEBUG((LOG_INFO, "pap_rauthack: ignoring missing msg-length.\n"));
|
||||||
} else {
|
} else {
|
||||||
GETCHAR(msglen, inp);
|
GETCHAR(msglen, inp);
|
||||||
@ -519,7 +522,7 @@ upap_rauthnak(upap_state *u, u_char *inp, int id, int len)
|
|||||||
* Parse message.
|
* Parse message.
|
||||||
*/
|
*/
|
||||||
if (len < sizeof (u_char)) {
|
if (len < sizeof (u_char)) {
|
||||||
UPAPDEBUG((LOG_INFO, "pap_rauthnak: rcvd short packet.\n"));
|
UPAPDEBUG((LOG_INFO, "pap_rauthnak: ignoring missing msg-length.\n"));
|
||||||
} else {
|
} else {
|
||||||
GETCHAR(msglen, inp);
|
GETCHAR(msglen, inp);
|
||||||
if(msglen > 0) {
|
if(msglen > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user