mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-04-10 06:44:18 +00:00
replaced BCOPY to lwip-MEMCPY
This commit is contained in:
parent
05aa1f1ae4
commit
7736cdae1c
@ -518,7 +518,7 @@ set_noauth_addr(argv)
|
|||||||
novm("allow-ip argument");
|
novm("allow-ip argument");
|
||||||
wp->word = (char *) (wp + 1);
|
wp->word = (char *) (wp + 1);
|
||||||
wp->next = noauth_addrs;
|
wp->next = noauth_addrs;
|
||||||
BCOPY(addr, wp->word, l);
|
MEMCPY(wp->word, addr, l);
|
||||||
noauth_addrs = wp;
|
noauth_addrs = wp;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -540,7 +540,7 @@ set_permitted_number(argv)
|
|||||||
novm("allow-number argument");
|
novm("allow-number argument");
|
||||||
wp->word = (char *) (wp + 1);
|
wp->word = (char *) (wp + 1);
|
||||||
wp->next = permitted_numbers;
|
wp->next = permitted_numbers;
|
||||||
BCOPY(number, wp->word, l);
|
MEMCPY(wp->word, number, l);
|
||||||
permitted_numbers = wp;
|
permitted_numbers = wp;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -987,7 +987,7 @@ auth_peer_success(unit, protocol, prot_flavor, name, namelen)
|
|||||||
*/
|
*/
|
||||||
if (namelen > sizeof(peer_authname) - 1)
|
if (namelen > sizeof(peer_authname) - 1)
|
||||||
namelen = sizeof(peer_authname) - 1;
|
namelen = sizeof(peer_authname) - 1;
|
||||||
BCOPY(name, peer_authname, namelen);
|
MEMCPY(peer_authname, name, namelen);
|
||||||
peer_authname[namelen] = 0;
|
peer_authname[namelen] = 0;
|
||||||
script_setenv("PEERNAME", peer_authname, 0);
|
script_setenv("PEERNAME", peer_authname, 0);
|
||||||
|
|
||||||
@ -1828,7 +1828,7 @@ get_secret(unit, client, server, secret, secret_len, am_server)
|
|||||||
len = MAXSECRETLEN;
|
len = MAXSECRETLEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
BCOPY(ppp_settings.passwd, secret, len);
|
MEMCPY(secret, ppp_settings.passwd, len);
|
||||||
*secret_len = len;
|
*secret_len = len;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -1892,7 +1892,7 @@ get_secret(unit, client, server, secret, secret_len, am_server)
|
|||||||
error("Secret for %s on %s is too long", client, server);
|
error("Secret for %s on %s is too long", client, server);
|
||||||
len = MAXSECRETLEN;
|
len = MAXSECRETLEN;
|
||||||
}
|
}
|
||||||
BCOPY(secbuf, secret, len);
|
MEMCPY(secret, secbuf, len);
|
||||||
BZERO(secbuf, sizeof(secbuf));
|
BZERO(secbuf, sizeof(secbuf));
|
||||||
*secret_len = len;
|
*secret_len = len;
|
||||||
|
|
||||||
|
@ -714,7 +714,7 @@ ccp_addci(f, p, lenp)
|
|||||||
p[1] = opt_buf[1] = CILEN_MPPE;
|
p[1] = opt_buf[1] = CILEN_MPPE;
|
||||||
MPPE_OPTS_TO_CI(go->mppe, &p[2]);
|
MPPE_OPTS_TO_CI(go->mppe, &p[2]);
|
||||||
MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]);
|
MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]);
|
||||||
BCOPY(mppe_recv_key, &opt_buf[CILEN_MPPE], MPPE_MAX_KEY_LEN);
|
MEMCPY(&opt_buf[CILEN_MPPE], mppe_recv_key, MPPE_MAX_KEY_LEN);
|
||||||
res = ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0);
|
res = ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0);
|
||||||
if (res > 0)
|
if (res > 0)
|
||||||
p += CILEN_MPPE;
|
p += CILEN_MPPE;
|
||||||
@ -1178,8 +1178,8 @@ ccp_reqci(f, p, lenp, dont_nak)
|
|||||||
u_char opt_buf[CILEN_MPPE + MPPE_MAX_KEY_LEN];
|
u_char opt_buf[CILEN_MPPE + MPPE_MAX_KEY_LEN];
|
||||||
int mtu;
|
int mtu;
|
||||||
|
|
||||||
BCOPY(p, opt_buf, CILEN_MPPE);
|
MEMCPY(opt_buf, p, CILEN_MPPE);
|
||||||
BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
|
MEMCPY(&opt_buf[CILEN_MPPE], mppe_send_key,
|
||||||
MPPE_MAX_KEY_LEN);
|
MPPE_MAX_KEY_LEN);
|
||||||
if (ccp_test(f->unit, opt_buf,
|
if (ccp_test(f->unit, opt_buf,
|
||||||
CILEN_MPPE + MPPE_MAX_KEY_LEN, 1) <= 0) {
|
CILEN_MPPE + MPPE_MAX_KEY_LEN, 1) <= 0) {
|
||||||
@ -1336,7 +1336,7 @@ ccp_reqci(f, p, lenp, dont_nak)
|
|||||||
retp = p0;
|
retp = p0;
|
||||||
ret = newret;
|
ret = newret;
|
||||||
if (p != retp)
|
if (p != retp)
|
||||||
BCOPY(p, retp, clen);
|
MEMCPY(retp, p, clen);
|
||||||
retp += clen;
|
retp += clen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -385,7 +385,7 @@ chapms_handle_failure(unsigned char *inp, int len)
|
|||||||
notice("Out of memory in chapms_handle_failure");
|
notice("Out of memory in chapms_handle_failure");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
BCOPY(inp, msg, len);
|
MEMCPY(msg, inp, len);
|
||||||
msg[len] = 0;
|
msg[len] = 0;
|
||||||
p = msg;
|
p = msg;
|
||||||
|
|
||||||
@ -454,7 +454,7 @@ ChallengeResponse(u_char *challenge,
|
|||||||
u_char des_key[8];
|
u_char des_key[8];
|
||||||
|
|
||||||
BZERO(ZPasswordHash, sizeof(ZPasswordHash));
|
BZERO(ZPasswordHash, sizeof(ZPasswordHash));
|
||||||
BCOPY(PasswordHash, ZPasswordHash, MD4_SIGNATURE_SIZE);
|
MEMCPY(ZPasswordHash, PasswordHash, MD4_SIGNATURE_SIZE);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
dbglog("ChallengeResponse - ZPasswordHash %.*B",
|
dbglog("ChallengeResponse - ZPasswordHash %.*B",
|
||||||
@ -499,7 +499,7 @@ ChallengeHash(u_char PeerChallenge[16], u_char *rchallenge,
|
|||||||
sha1_update(&sha1Context, (unsigned char *)user, strlen(user));
|
sha1_update(&sha1Context, (unsigned char *)user, strlen(user));
|
||||||
sha1_finish(&sha1Context, sha1Hash);
|
sha1_finish(&sha1Context, sha1Hash);
|
||||||
|
|
||||||
BCOPY(sha1Hash, Challenge, 8);
|
MEMCPY(Challenge, sha1Hash, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -677,8 +677,8 @@ mppe_set_keys(u_char *rchallenge, u_char PasswordHashHash[MD4_SIGNATURE_SIZE])
|
|||||||
sha1_finish(&sha1Context, Digest);
|
sha1_finish(&sha1Context, Digest);
|
||||||
|
|
||||||
/* Same key in both directions. */
|
/* Same key in both directions. */
|
||||||
BCOPY(Digest, mppe_send_key, sizeof(mppe_send_key));
|
MEMCPY(mppe_send_key, Digest, sizeof(mppe_send_key));
|
||||||
BCOPY(Digest, mppe_recv_key, sizeof(mppe_recv_key));
|
MEMCPY(mppe_recv_key, Digest, sizeof(mppe_recv_key));
|
||||||
|
|
||||||
mppe_keys_set = 1;
|
mppe_keys_set = 1;
|
||||||
}
|
}
|
||||||
@ -777,7 +777,7 @@ mppe_set_keys2(u_char PasswordHashHash[MD4_SIGNATURE_SIZE],
|
|||||||
sha1_update(&sha1Context, SHApad2, sizeof(SHApad2));
|
sha1_update(&sha1Context, SHApad2, sizeof(SHApad2));
|
||||||
sha1_finish(&sha1Context, Digest);
|
sha1_finish(&sha1Context, Digest);
|
||||||
|
|
||||||
BCOPY(Digest, mppe_send_key, sizeof(mppe_send_key));
|
MEMCPY(mppe_send_key, Digest, sizeof(mppe_send_key));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* generate recv key
|
* generate recv key
|
||||||
@ -793,7 +793,7 @@ mppe_set_keys2(u_char PasswordHashHash[MD4_SIGNATURE_SIZE],
|
|||||||
sha1_update(&sha1Context, SHApad2, sizeof(SHApad2));
|
sha1_update(&sha1Context, SHApad2, sizeof(SHApad2));
|
||||||
sha1_finish(&sha1Context, Digest);
|
sha1_finish(&sha1Context, Digest);
|
||||||
|
|
||||||
BCOPY(Digest, mppe_recv_key, sizeof(mppe_recv_key));
|
MEMCPY(mppe_recv_key, Digest, sizeof(mppe_recv_key));
|
||||||
|
|
||||||
mppe_keys_set = 1;
|
mppe_keys_set = 1;
|
||||||
}
|
}
|
||||||
@ -867,7 +867,7 @@ ChapMS2(u_char *rchallenge, u_char *PeerChallenge,
|
|||||||
for (i = 0; i < MS_CHAP2_PEER_CHAL_LEN; i++)
|
for (i = 0; i < MS_CHAP2_PEER_CHAL_LEN; i++)
|
||||||
*p++ = (u_char) (drand48() * 0xff);
|
*p++ = (u_char) (drand48() * 0xff);
|
||||||
else
|
else
|
||||||
BCOPY(PeerChallenge, &response[MS_CHAP2_PEER_CHALLENGE],
|
MEMCPY(&response[MS_CHAP2_PEER_CHALLENGE], PeerChallenge,
|
||||||
MS_CHAP2_PEER_CHAL_LEN);
|
MS_CHAP2_PEER_CHAL_LEN);
|
||||||
|
|
||||||
/* Generate the NT-Response */
|
/* Generate the NT-Response */
|
||||||
|
@ -483,7 +483,7 @@ int status;
|
|||||||
i = 7;
|
i = 7;
|
||||||
esp->es_server.ea_peerlen = plen;
|
esp->es_server.ea_peerlen = plen;
|
||||||
dp = (unsigned char *)esp->es_server.ea_peer;
|
dp = (unsigned char *)esp->es_server.ea_peer;
|
||||||
BCOPY(clear + 1, dp, i);
|
MEMCPY(dp, clear + 1, i);
|
||||||
plen -= i;
|
plen -= i;
|
||||||
dp += i;
|
dp += i;
|
||||||
sp = secbuf + 8;
|
sp = secbuf + 8;
|
||||||
@ -687,7 +687,7 @@ eap_state *esp;
|
|||||||
PUTCHAR(EAPT_IDENTITY, outp);
|
PUTCHAR(EAPT_IDENTITY, outp);
|
||||||
str = "Name";
|
str = "Name";
|
||||||
challen = strlen(str);
|
challen = strlen(str);
|
||||||
BCOPY(str, outp, challen);
|
MEMCPY(outp, str, challen);
|
||||||
INCPTR(challen, outp);
|
INCPTR(challen, outp);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -705,9 +705,9 @@ eap_state *esp;
|
|||||||
ptr = esp->es_challenge;
|
ptr = esp->es_challenge;
|
||||||
while (--challen >= 0)
|
while (--challen >= 0)
|
||||||
*ptr++ = (u_char) (drand48() * 0x100);
|
*ptr++ = (u_char) (drand48() * 0x100);
|
||||||
BCOPY(esp->es_challenge, outp, esp->es_challen);
|
MEMCPY(outp, esp->es_challenge, esp->es_challen);
|
||||||
INCPTR(esp->es_challen, outp);
|
INCPTR(esp->es_challen, outp);
|
||||||
BCOPY(esp->es_server.ea_name, outp, esp->es_server.ea_namelen);
|
MEMCPY(outp, esp->es_server.ea_name, esp->es_server.ea_namelen);
|
||||||
INCPTR(esp->es_server.ea_namelen, outp);
|
INCPTR(esp->es_server.ea_namelen, outp);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -717,26 +717,26 @@ eap_state *esp;
|
|||||||
PUTCHAR(EAPSRP_CHALLENGE, outp);
|
PUTCHAR(EAPSRP_CHALLENGE, outp);
|
||||||
|
|
||||||
PUTCHAR(esp->es_server.ea_namelen, outp);
|
PUTCHAR(esp->es_server.ea_namelen, outp);
|
||||||
BCOPY(esp->es_server.ea_name, outp, esp->es_server.ea_namelen);
|
MEMCPY(outp, esp->es_server.ea_name, esp->es_server.ea_namelen);
|
||||||
INCPTR(esp->es_server.ea_namelen, outp);
|
INCPTR(esp->es_server.ea_namelen, outp);
|
||||||
|
|
||||||
ts = (struct t_server *)esp->es_server.ea_session;
|
ts = (struct t_server *)esp->es_server.ea_session;
|
||||||
assert(ts != NULL);
|
assert(ts != NULL);
|
||||||
PUTCHAR(ts->s.len, outp);
|
PUTCHAR(ts->s.len, outp);
|
||||||
BCOPY(ts->s.data, outp, ts->s.len);
|
MEMCPY(outp, ts->s.data, ts->s.len);
|
||||||
INCPTR(ts->s.len, outp);
|
INCPTR(ts->s.len, outp);
|
||||||
|
|
||||||
if (ts->g.len == 1 && ts->g.data[0] == 2) {
|
if (ts->g.len == 1 && ts->g.data[0] == 2) {
|
||||||
PUTCHAR(0, outp);
|
PUTCHAR(0, outp);
|
||||||
} else {
|
} else {
|
||||||
PUTCHAR(ts->g.len, outp);
|
PUTCHAR(ts->g.len, outp);
|
||||||
BCOPY(ts->g.data, outp, ts->g.len);
|
MEMCPY(outp, ts->g.data, ts->g.len);
|
||||||
INCPTR(ts->g.len, outp);
|
INCPTR(ts->g.len, outp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ts->n.len != sizeof (wkmodulus) ||
|
if (ts->n.len != sizeof (wkmodulus) ||
|
||||||
BCMP(ts->n.data, wkmodulus, sizeof (wkmodulus)) != 0) {
|
BCMP(ts->n.data, wkmodulus, sizeof (wkmodulus)) != 0) {
|
||||||
BCOPY(ts->n.data, outp, ts->n.len);
|
MEMCPY(outp, ts->n.data, ts->n.len);
|
||||||
INCPTR(ts->n.len, outp);
|
INCPTR(ts->n.len, outp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -747,7 +747,7 @@ eap_state *esp;
|
|||||||
|
|
||||||
ts = (struct t_server *)esp->es_server.ea_session;
|
ts = (struct t_server *)esp->es_server.ea_session;
|
||||||
assert(ts != NULL);
|
assert(ts != NULL);
|
||||||
BCOPY(ts->B.data, outp, ts->B.len);
|
MEMCPY(outp, ts->B.data, ts->B.len);
|
||||||
INCPTR(ts->B.len, outp);
|
INCPTR(ts->B.len, outp);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -757,7 +757,7 @@ eap_state *esp;
|
|||||||
PUTLONG(SRPVAL_EBIT, outp);
|
PUTLONG(SRPVAL_EBIT, outp);
|
||||||
ts = (struct t_server *)esp->es_server.ea_session;
|
ts = (struct t_server *)esp->es_server.ea_session;
|
||||||
assert(ts != NULL);
|
assert(ts != NULL);
|
||||||
BCOPY(t_serverresponse(ts), outp, SHA_DIGESTSIZE);
|
MEMCPY(outp, t_serverresponse(ts), SHA_DIGESTSIZE);
|
||||||
INCPTR(SHA_DIGESTSIZE, outp);
|
INCPTR(SHA_DIGESTSIZE, outp);
|
||||||
|
|
||||||
if (pncrypt_setkey(0)) {
|
if (pncrypt_setkey(0)) {
|
||||||
@ -767,7 +767,7 @@ eap_state *esp;
|
|||||||
if ((j = i = esp->es_server.ea_peerlen) > 7)
|
if ((j = i = esp->es_server.ea_peerlen) > 7)
|
||||||
j = 7;
|
j = 7;
|
||||||
clear[0] = i;
|
clear[0] = i;
|
||||||
BCOPY(cp, clear + 1, j);
|
MEMCPY(clear + 1, cp, j);
|
||||||
i -= j;
|
i -= j;
|
||||||
cp += j;
|
cp += j;
|
||||||
/* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */
|
/* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */
|
||||||
@ -786,7 +786,7 @@ eap_state *esp;
|
|||||||
i -= 8;
|
i -= 8;
|
||||||
}
|
}
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
BCOPY(cp, clear, i);
|
MEMCPY(clear, cp, i);
|
||||||
cp += i;
|
cp += i;
|
||||||
while (i < 8) {
|
while (i < 8) {
|
||||||
*cp++ = drand48() * 0x100;
|
*cp++ = drand48() * 0x100;
|
||||||
@ -840,7 +840,7 @@ eap_state *esp;
|
|||||||
ptr = esp->es_challenge;
|
ptr = esp->es_challenge;
|
||||||
while (--challen >= 0)
|
while (--challen >= 0)
|
||||||
*ptr++ = drand48() * 0x100;
|
*ptr++ = drand48() * 0x100;
|
||||||
BCOPY(esp->es_challenge, outp, esp->es_challen);
|
MEMCPY(outp, esp->es_challenge, esp->es_challen);
|
||||||
INCPTR(esp->es_challen, outp);
|
INCPTR(esp->es_challen, outp);
|
||||||
break;
|
break;
|
||||||
#endif /* USE_SRP */
|
#endif /* USE_SRP */
|
||||||
@ -1056,7 +1056,7 @@ int lenstr;
|
|||||||
PUTSHORT(msglen, outp);
|
PUTSHORT(msglen, outp);
|
||||||
PUTCHAR(typenum, outp);
|
PUTCHAR(typenum, outp);
|
||||||
if (lenstr > 0) {
|
if (lenstr > 0) {
|
||||||
BCOPY(str, outp, lenstr);
|
MEMCPY(outp, str, lenstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
output(esp->es_unit, outpacket_buf, PPP_HDRLEN + msglen);
|
output(esp->es_unit, outpacket_buf, PPP_HDRLEN + msglen);
|
||||||
@ -1088,10 +1088,10 @@ int namelen;
|
|||||||
PUTSHORT(msglen, outp);
|
PUTSHORT(msglen, outp);
|
||||||
PUTCHAR(EAPT_MD5CHAP, outp);
|
PUTCHAR(EAPT_MD5CHAP, outp);
|
||||||
PUTCHAR(MD5_SIGNATURE_SIZE, outp);
|
PUTCHAR(MD5_SIGNATURE_SIZE, outp);
|
||||||
BCOPY(hash, outp, MD5_SIGNATURE_SIZE);
|
MEMCPY(outp, hash, MD5_SIGNATURE_SIZE);
|
||||||
INCPTR(MD5_SIGNATURE_SIZE, outp);
|
INCPTR(MD5_SIGNATURE_SIZE, outp);
|
||||||
if (namelen > 0) {
|
if (namelen > 0) {
|
||||||
BCOPY(name, outp, namelen);
|
MEMCPY(outp, name, namelen);
|
||||||
}
|
}
|
||||||
|
|
||||||
output(esp->es_unit, outpacket_buf, PPP_HDRLEN + msglen);
|
output(esp->es_unit, outpacket_buf, PPP_HDRLEN + msglen);
|
||||||
@ -1124,7 +1124,7 @@ int lenstr;
|
|||||||
PUTCHAR(EAPT_SRP, outp);
|
PUTCHAR(EAPT_SRP, outp);
|
||||||
PUTCHAR(subtypenum, outp);
|
PUTCHAR(subtypenum, outp);
|
||||||
if (lenstr > 0) {
|
if (lenstr > 0) {
|
||||||
BCOPY(str, outp, lenstr);
|
MEMCPY(outp, str, lenstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
output(esp->es_unit, outpacket_buf, PPP_HDRLEN + msglen);
|
output(esp->es_unit, outpacket_buf, PPP_HDRLEN + msglen);
|
||||||
@ -1156,7 +1156,7 @@ u_char *str;
|
|||||||
PUTCHAR(EAPT_SRP, outp);
|
PUTCHAR(EAPT_SRP, outp);
|
||||||
PUTCHAR(EAPSRP_CVALIDATOR, outp);
|
PUTCHAR(EAPSRP_CVALIDATOR, outp);
|
||||||
PUTLONG(flags, outp);
|
PUTLONG(flags, outp);
|
||||||
BCOPY(str, outp, SHA_DIGESTSIZE);
|
MEMCPY(outp, str, SHA_DIGESTSIZE);
|
||||||
|
|
||||||
output(esp->es_unit, outpacket_buf, PPP_HDRLEN + msglen);
|
output(esp->es_unit, outpacket_buf, PPP_HDRLEN + msglen);
|
||||||
}
|
}
|
||||||
@ -1419,10 +1419,10 @@ int len;
|
|||||||
/* Not so likely to happen. */
|
/* Not so likely to happen. */
|
||||||
if (vallen >= len + sizeof (rhostname)) {
|
if (vallen >= len + sizeof (rhostname)) {
|
||||||
dbglog("EAP: trimming really long peer name down");
|
dbglog("EAP: trimming really long peer name down");
|
||||||
BCOPY(inp + vallen, rhostname, sizeof (rhostname) - 1);
|
MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1);
|
||||||
rhostname[sizeof (rhostname) - 1] = '\0';
|
rhostname[sizeof (rhostname) - 1] = '\0';
|
||||||
} else {
|
} else {
|
||||||
BCOPY(inp + vallen, rhostname, len - vallen);
|
MEMCPY(rhostname, inp + vallen, len - vallen);
|
||||||
rhostname[len - vallen] = '\0';
|
rhostname[len - vallen] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1491,7 +1491,7 @@ int len;
|
|||||||
/* Ignore badly-formed messages */
|
/* Ignore badly-formed messages */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
BCOPY(inp, rhostname, vallen);
|
MEMCPY(rhostname, inp, vallen);
|
||||||
rhostname[vallen] = '\0';
|
rhostname[vallen] = '\0';
|
||||||
INCPTR(vallen, inp);
|
INCPTR(vallen, inp);
|
||||||
len -= vallen;
|
len -= vallen;
|
||||||
@ -1766,7 +1766,7 @@ int len;
|
|||||||
eap_figure_next_state(esp, 1);
|
eap_figure_next_state(esp, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
BCOPY(inp, esp->es_server.ea_peer, len);
|
MEMCPY(esp->es_server.ea_peer, inp, len);
|
||||||
esp->es_server.ea_peer[len] = '\0';
|
esp->es_server.ea_peer[len] = '\0';
|
||||||
esp->es_server.ea_peerlen = len;
|
esp->es_server.ea_peerlen = len;
|
||||||
eap_figure_next_state(esp, 0);
|
eap_figure_next_state(esp, 0);
|
||||||
@ -1845,10 +1845,10 @@ int len;
|
|||||||
/* Not so likely to happen. */
|
/* Not so likely to happen. */
|
||||||
if (vallen >= len + sizeof (rhostname)) {
|
if (vallen >= len + sizeof (rhostname)) {
|
||||||
dbglog("EAP: trimming really long peer name down");
|
dbglog("EAP: trimming really long peer name down");
|
||||||
BCOPY(inp + vallen, rhostname, sizeof (rhostname) - 1);
|
MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1);
|
||||||
rhostname[sizeof (rhostname) - 1] = '\0';
|
rhostname[sizeof (rhostname) - 1] = '\0';
|
||||||
} else {
|
} else {
|
||||||
BCOPY(inp + vallen, rhostname, len - vallen);
|
MEMCPY(rhostname, inp + vallen, len - vallen);
|
||||||
rhostname[len - vallen] = '\0';
|
rhostname[len - vallen] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -814,7 +814,7 @@ fsm_sdata(f, code, id, data, datalen)
|
|||||||
if (datalen > peer_mru[f->unit] - HEADERLEN)
|
if (datalen > peer_mru[f->unit] - HEADERLEN)
|
||||||
datalen = peer_mru[f->unit] - HEADERLEN;
|
datalen = peer_mru[f->unit] - HEADERLEN;
|
||||||
if (datalen && data != outp + PPP_HDRLEN + HEADERLEN)
|
if (datalen && data != outp + PPP_HDRLEN + HEADERLEN)
|
||||||
BCOPY(data, outp + PPP_HDRLEN + HEADERLEN, datalen);
|
MEMCPY(outp + PPP_HDRLEN + HEADERLEN, data, datalen);
|
||||||
outlen = datalen + HEADERLEN;
|
outlen = datalen + HEADERLEN;
|
||||||
MAKEHEADER(outp, f->protocol);
|
MAKEHEADER(outp, f->protocol);
|
||||||
PUTCHAR(code, outp);
|
PUTCHAR(code, outp);
|
||||||
|
@ -1660,7 +1660,7 @@ endswitch:
|
|||||||
|
|
||||||
/* Need to move CI? */
|
/* Need to move CI? */
|
||||||
if (ucp != cip)
|
if (ucp != cip)
|
||||||
BCOPY(cip, ucp, cilen); /* Move it */
|
MEMCPY(ucp, cip, cilen); /* Move it */
|
||||||
|
|
||||||
/* Update output pointer */
|
/* Update output pointer */
|
||||||
INCPTR(cilen, ucp);
|
INCPTR(cilen, ucp);
|
||||||
|
@ -1935,7 +1935,7 @@ lcp_reqci(f, inp, lenp, reject_if_disagree)
|
|||||||
ho->neg_endpoint = 1;
|
ho->neg_endpoint = 1;
|
||||||
ho->endpoint.class = cichar;
|
ho->endpoint.class = cichar;
|
||||||
ho->endpoint.length = cilen;
|
ho->endpoint.length = cilen;
|
||||||
BCOPY(p, ho->endpoint.value, cilen);
|
MEMCPY(ho->endpoint.value, p, cilen);
|
||||||
INCPTR(cilen, p);
|
INCPTR(cilen, p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1963,7 +1963,7 @@ endswitch:
|
|||||||
if (orc == CONFREJ) { /* Reject this CI */
|
if (orc == CONFREJ) { /* Reject this CI */
|
||||||
rc = CONFREJ;
|
rc = CONFREJ;
|
||||||
if (cip != rejp) /* Need to move rejected CI? */
|
if (cip != rejp) /* Need to move rejected CI? */
|
||||||
BCOPY(cip, rejp, cilen); /* Move it */
|
MEMCPY(rejp, cip, cilen); /* Move it */
|
||||||
INCPTR(cilen, rejp); /* Update output pointer */
|
INCPTR(cilen, rejp); /* Update output pointer */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1984,7 +1984,7 @@ endswitch:
|
|||||||
* Copy the Nak'd options from the nak_buffer to the caller's buffer.
|
* Copy the Nak'd options from the nak_buffer to the caller's buffer.
|
||||||
*/
|
*/
|
||||||
*lenp = nakp - nak_buffer;
|
*lenp = nakp - nak_buffer;
|
||||||
BCOPY(nak_buffer, inp, *lenp);
|
MEMCPY(inp, nak_buffer, *lenp);
|
||||||
break;
|
break;
|
||||||
case CONFREJ:
|
case CONFREJ:
|
||||||
*lenp = rejp - inp;
|
*lenp = rejp - inp;
|
||||||
@ -2267,7 +2267,7 @@ lcp_printpkt(p, plen, printer, arg)
|
|||||||
if (epd.length > MAX_ENDP_LEN)
|
if (epd.length > MAX_ENDP_LEN)
|
||||||
epd.length = MAX_ENDP_LEN;
|
epd.length = MAX_ENDP_LEN;
|
||||||
if (epd.length > 0) {
|
if (epd.length > 0) {
|
||||||
BCOPY(p, epd.value, epd.length);
|
MEMCPY(epd.value, p, epd.length);
|
||||||
p += epd.length;
|
p += epd.length;
|
||||||
}
|
}
|
||||||
printer(arg, "endpoint [%s]", epdisc_to_str(&epd));
|
printer(arg, "endpoint [%s]", epdisc_to_str(&epd));
|
||||||
|
@ -42,6 +42,8 @@
|
|||||||
* $Id: pppd.h,v 1.96 2008/06/23 11:47:18 paulus Exp $
|
* $Id: pppd.h,v 1.96 2008/06/23 11:47:18 paulus Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "lwip/opt.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO:
|
* TODO:
|
||||||
*/
|
*/
|
||||||
@ -784,7 +786,6 @@ extern void (*snoop_send_hook) __P((unsigned char *p, int len));
|
|||||||
#define TIMEOUTMS(f, a, t) do { sys_untimeout((f), (a)); sys_timeout((t), (f), (a)); } while(0)
|
#define TIMEOUTMS(f, a, t) do { sys_untimeout((f), (a)); sys_timeout((t), (f), (a)); } while(0)
|
||||||
#define UNTIMEOUT(f, a) sys_untimeout((f), (a))
|
#define UNTIMEOUT(f, a) sys_untimeout((f), (a))
|
||||||
|
|
||||||
#define BCOPY(s, d, l) memcpy(d, s, l)
|
|
||||||
#define BZERO(s, n) memset(s, 0, n)
|
#define BZERO(s, n) memset(s, 0, n)
|
||||||
#define BCMP(s1, s2, l) memcmp(s1, s2, l)
|
#define BCMP(s1, s2, l) memcmp(s1, s2, l)
|
||||||
|
|
||||||
|
@ -571,10 +571,10 @@ upap_sauthreq(u)
|
|||||||
PUTCHAR(++u->us_id, outp);
|
PUTCHAR(++u->us_id, outp);
|
||||||
PUTSHORT(outlen, outp);
|
PUTSHORT(outlen, outp);
|
||||||
PUTCHAR(u->us_userlen, outp);
|
PUTCHAR(u->us_userlen, outp);
|
||||||
BCOPY(u->us_user, outp, u->us_userlen);
|
MEMCPY(outp, u->us_user, u->us_userlen);
|
||||||
INCPTR(u->us_userlen, outp);
|
INCPTR(u->us_userlen, outp);
|
||||||
PUTCHAR(u->us_passwdlen, outp);
|
PUTCHAR(u->us_passwdlen, outp);
|
||||||
BCOPY(u->us_passwd, outp, u->us_passwdlen);
|
MEMCPY(outp, u->us_passwd, u->us_passwdlen);
|
||||||
|
|
||||||
output(u->us_unit, outpacket_buf, outlen + PPP_HDRLEN);
|
output(u->us_unit, outpacket_buf, outlen + PPP_HDRLEN);
|
||||||
|
|
||||||
@ -605,7 +605,7 @@ upap_sresp(u, code, id, msg, msglen)
|
|||||||
PUTCHAR(id, outp);
|
PUTCHAR(id, outp);
|
||||||
PUTSHORT(outlen, outp);
|
PUTSHORT(outlen, outp);
|
||||||
PUTCHAR(msglen, outp);
|
PUTCHAR(msglen, outp);
|
||||||
BCOPY(msg, outp, msglen);
|
MEMCPY(outp, msg, msglen);
|
||||||
output(u->us_unit, outpacket_buf, outlen + PPP_HDRLEN);
|
output(u->us_unit, outpacket_buf, outlen + PPP_HDRLEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user