mirror of https://github.com/ARMmbed/mbed-os.git
Removed pbuf operations that were commented out
parent
a2df462f65
commit
3102bb1340
|
|
@ -237,12 +237,10 @@ static void chap_timeout(void *arg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(pcb->chap_server.challenge_pktlen), PPP_BUF_HEAP);
|
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(pcb->chap_server.challenge_pktlen), PPP_BUF_HEAP);
|
||||||
//p = pbuf_alloc(PBUF_RAW, (u16_t)(pcb->chap_server.challenge_pktlen), PPP_CTRL_PBUF_TYPE);
|
|
||||||
if(NULL == p)
|
if(NULL == p)
|
||||||
return;
|
return;
|
||||||
if(p->tot_len != p->len) {
|
if(p->tot_len != p->len) {
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MEMCPY(p->payload, pcb->chap_server.challenge, pcb->chap_server.challenge_pktlen);
|
MEMCPY(p->payload, pcb->chap_server.challenge, pcb->chap_server.challenge_pktlen);
|
||||||
|
|
@ -348,12 +346,10 @@ static void chap_handle_response(ppp_pcb *pcb, int id,
|
||||||
mlen = strlen(message);
|
mlen = strlen(message);
|
||||||
len = CHAP_HDRLEN + mlen;
|
len = CHAP_HDRLEN + mlen;
|
||||||
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN +len), PPP_BUF_HEAP);
|
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN +len), PPP_BUF_HEAP);
|
||||||
//p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN +len), PPP_CTRL_PBUF_TYPE);
|
|
||||||
if(NULL == p)
|
if(NULL == p)
|
||||||
return;
|
return;
|
||||||
if(p->tot_len != p->len) {
|
if(p->tot_len != p->len) {
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -446,12 +442,10 @@ static void chap_respond(ppp_pcb *pcb, int id,
|
||||||
char secret[MAXSECRETLEN+1];
|
char secret[MAXSECRETLEN+1];
|
||||||
|
|
||||||
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(RESP_MAX_PKTLEN), PPP_BUF_HEAP);
|
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(RESP_MAX_PKTLEN), PPP_BUF_HEAP);
|
||||||
//p = pbuf_alloc(PBUF_RAW, (u16_t)(RESP_MAX_PKTLEN), PPP_CTRL_PBUF_TYPE);
|
|
||||||
if(NULL == p)
|
if(NULL == p)
|
||||||
return;
|
return;
|
||||||
if(p->tot_len != p->len) {
|
if(p->tot_len != p->len) {
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -252,12 +252,10 @@ static void eap_send_failure(ppp_pcb *pcb) {
|
||||||
u_char *outp;
|
u_char *outp;
|
||||||
|
|
||||||
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_BUF_HEAP);
|
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_BUF_HEAP);
|
||||||
//p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE);
|
|
||||||
if(NULL == p)
|
if(NULL == p)
|
||||||
return;
|
return;
|
||||||
if(p->tot_len != p->len) {
|
if(p->tot_len != p->len) {
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -285,12 +283,10 @@ static void eap_send_success(ppp_pcb *pcb) {
|
||||||
u_char *outp;
|
u_char *outp;
|
||||||
|
|
||||||
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_BUF_HEAP);
|
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_BUF_HEAP);
|
||||||
//p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE);
|
|
||||||
if(NULL == p)
|
if(NULL == p)
|
||||||
return;
|
return;
|
||||||
if(p->tot_len != p->len) {
|
if(p->tot_len != p->len) {
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -688,12 +684,10 @@ static void eap_send_request(ppp_pcb *pcb) {
|
||||||
}
|
}
|
||||||
|
|
||||||
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_CTRL_PBUF_MAX_SIZE), PPP_BUF_HEAP);
|
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_CTRL_PBUF_MAX_SIZE), PPP_BUF_HEAP);
|
||||||
//p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_CTRL_PBUF_MAX_SIZE), PPP_CTRL_PBUF_TYPE);
|
|
||||||
if(NULL == p)
|
if(NULL == p)
|
||||||
return;
|
return;
|
||||||
if(p->tot_len != p->len) {
|
if(p->tot_len != p->len) {
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1025,12 +1019,10 @@ static void eap_send_response(ppp_pcb *pcb, u_char id, u_char typenum, const u_c
|
||||||
|
|
||||||
msglen = EAP_HEADERLEN + sizeof (u_char) + lenstr;
|
msglen = EAP_HEADERLEN + sizeof (u_char) + lenstr;
|
||||||
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN + msglen), PPP_BUF_HEAP);
|
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN + msglen), PPP_BUF_HEAP);
|
||||||
//p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE);
|
|
||||||
if(NULL == p)
|
if(NULL == p)
|
||||||
return;
|
return;
|
||||||
if(p->tot_len != p->len) {
|
if(p->tot_len != p->len) {
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1061,12 +1053,10 @@ static void eap_chap_response(ppp_pcb *pcb, u_char id, u_char *hash, const char
|
||||||
msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + MD5_SIGNATURE_SIZE +
|
msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + MD5_SIGNATURE_SIZE +
|
||||||
namelen;
|
namelen;
|
||||||
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN + msglen), PPP_BUF_HEAP);
|
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN + msglen), PPP_BUF_HEAP);
|
||||||
//p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE);
|
|
||||||
if(NULL == p)
|
if(NULL == p)
|
||||||
return;
|
return;
|
||||||
if(p->tot_len != p->len) {
|
if(p->tot_len != p->len) {
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1108,12 +1098,10 @@ int lenstr;
|
||||||
|
|
||||||
msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + lenstr;
|
msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + lenstr;
|
||||||
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN + msglen), PPP_BUF_HEAP);
|
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN + msglen), PPP_BUF_HEAP);
|
||||||
//p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE);
|
|
||||||
if(NULL == p)
|
if(NULL == p)
|
||||||
return;
|
return;
|
||||||
if(p->tot_len != p->len) {
|
if(p->tot_len != p->len) {
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1152,12 +1140,10 @@ u_char *str;
|
||||||
msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + sizeof (u32_t) +
|
msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + sizeof (u32_t) +
|
||||||
SHA_DIGESTSIZE;
|
SHA_DIGESTSIZE;
|
||||||
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN + msglen), PPP_BUF_HEAP);
|
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN + msglen), PPP_BUF_HEAP);
|
||||||
//p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE);
|
|
||||||
if(NULL == p)
|
if(NULL == p)
|
||||||
return;
|
return;
|
||||||
if(p->tot_len != p->len) {
|
if(p->tot_len != p->len) {
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1185,12 +1171,10 @@ static void eap_send_nak(ppp_pcb *pcb, u_char id, u_char type) {
|
||||||
|
|
||||||
msglen = EAP_HEADERLEN + 2 * sizeof (u_char);
|
msglen = EAP_HEADERLEN + 2 * sizeof (u_char);
|
||||||
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN + msglen), PPP_BUF_HEAP);
|
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN + msglen), PPP_BUF_HEAP);
|
||||||
//p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE);
|
|
||||||
if(NULL == p)
|
if(NULL == p)
|
||||||
return;
|
return;
|
||||||
if(p->tot_len != p->len) {
|
if(p->tot_len != p->len) {
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -736,12 +736,10 @@ static void fsm_sconfreq(fsm *f, int retransmit) {
|
||||||
cilen = 0;
|
cilen = 0;
|
||||||
|
|
||||||
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, cilen + HEADERLEN + PPP_HDRLEN, PPP_BUF_HEAP);
|
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, cilen + HEADERLEN + PPP_HDRLEN, PPP_BUF_HEAP);
|
||||||
//p = pbuf_alloc(PBUF_RAW, (u16_t)(cilen + HEADERLEN + PPP_HDRLEN), PPP_CTRL_PBUF_TYPE);
|
|
||||||
if(NULL == p)
|
if(NULL == p)
|
||||||
return;
|
return;
|
||||||
if(p->tot_len != p->len) {
|
if(p->tot_len != p->len) {
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -782,13 +780,11 @@ void fsm_sdata(fsm *f, u_char code, u_char id, const u_char *data, int datalen)
|
||||||
outlen = datalen + HEADERLEN;
|
outlen = datalen + HEADERLEN;
|
||||||
|
|
||||||
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(outlen + PPP_HDRLEN), PPP_BUF_HEAP);
|
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(outlen + PPP_HDRLEN), PPP_BUF_HEAP);
|
||||||
//p = pbuf_alloc(PBUF_RAW, (u16_t)(outlen + PPP_HDRLEN), PPP_CTRL_PBUF_TYPE);
|
|
||||||
|
|
||||||
if(NULL == p)
|
if(NULL == p)
|
||||||
return;
|
return;
|
||||||
if(p->tot_len != p->len) {
|
if(p->tot_len != p->len) {
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
outp = (u_char*)p->payload;
|
outp = (u_char*)p->payload;
|
||||||
|
|
|
||||||
|
|
@ -1846,12 +1846,10 @@ static int lcp_reqci(fsm *f, u_char *inp, int *lenp, int reject_if_disagree) {
|
||||||
next = inp;
|
next = inp;
|
||||||
|
|
||||||
nakp = ppp_memory_buffer_allocate(pcb->netif->memory_manager, PPP_CTRL_PBUF_MAX_SIZE, PPP_BUF_HEAP);
|
nakp = ppp_memory_buffer_allocate(pcb->netif->memory_manager, PPP_CTRL_PBUF_MAX_SIZE, PPP_BUF_HEAP);
|
||||||
//nakp = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_CTRL_PBUF_MAX_SIZE), PPP_CTRL_PBUF_TYPE);
|
|
||||||
if(NULL == nakp)
|
if(NULL == nakp)
|
||||||
return 0;
|
return 0;
|
||||||
if(nakp->tot_len != nakp->len) {
|
if(nakp->tot_len != nakp->len) {
|
||||||
ppp_memory_buffer_free(nakp);
|
ppp_memory_buffer_free(nakp);
|
||||||
//pbuf_free(nakp);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2285,7 +2283,6 @@ endswitch:
|
||||||
}
|
}
|
||||||
|
|
||||||
ppp_memory_buffer_free(nakp);
|
ppp_memory_buffer_free(nakp);
|
||||||
//pbuf_free(nakp);
|
|
||||||
LCPDEBUG(("lcp_reqci: returning CONF%s.", CODENAME(rc)));
|
LCPDEBUG(("lcp_reqci: returning CONF%s.", CODENAME(rc)));
|
||||||
return (rc); /* Return final code */
|
return (rc); /* Return final code */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,6 @@ mppe_compress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb, u16_t proto
|
||||||
* the whole packet before encryption.
|
* the whole packet before encryption.
|
||||||
*/
|
*/
|
||||||
np = ppp_memory_buffer_allocate(pcb->netif->memory_manager, MPPE_OVHD + sizeof(protocol) + (*pb)->tot_len, PPP_BUF_HEAP);
|
np = ppp_memory_buffer_allocate(pcb->netif->memory_manager, MPPE_OVHD + sizeof(protocol) + (*pb)->tot_len, PPP_BUF_HEAP);
|
||||||
//np = pbuf_alloc(PBUF_RAW, MPPE_OVHD + sizeof(protocol) + (*pb)->tot_len, PBUF_RAM);
|
|
||||||
if (!np) {
|
if (!np) {
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
|
@ -210,7 +209,6 @@ mppe_compress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb, u16_t proto
|
||||||
|
|
||||||
if ((err = pbuf_copy(np, *pb)) != ERR_OK) {
|
if ((err = pbuf_copy(np, *pb)) != ERR_OK) {
|
||||||
ppp_memory_buffer_free(np);
|
ppp_memory_buffer_free(np);
|
||||||
//pbuf_free(np);
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -553,7 +553,6 @@ static err_t ppp_netif_output(struct netif *netif, struct pbuf *pb, u16_t protoc
|
||||||
/* if VJ compressor returned a new allocated pbuf, free it */
|
/* if VJ compressor returned a new allocated pbuf, free it */
|
||||||
if (fpb) {
|
if (fpb) {
|
||||||
ppp_memory_buffer_free(fpb);
|
ppp_memory_buffer_free(fpb);
|
||||||
//pbuf_free(fpb);
|
|
||||||
}
|
}
|
||||||
/* mppe_compress() returns a new allocated pbuf, indicate we should free
|
/* mppe_compress() returns a new allocated pbuf, indicate we should free
|
||||||
* our duplicated pbuf later */
|
* our duplicated pbuf later */
|
||||||
|
|
@ -578,7 +577,6 @@ err_rte_drop:
|
||||||
err:
|
err:
|
||||||
if (fpb) {
|
if (fpb) {
|
||||||
ppp_memory_buffer_free(fpb);
|
ppp_memory_buffer_free(fpb);
|
||||||
//pbuf_free(fpb);
|
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
@ -955,7 +953,6 @@ drop:
|
||||||
|
|
||||||
out:
|
out:
|
||||||
ppp_memory_buffer_free(pb);
|
ppp_memory_buffer_free(pb);
|
||||||
//pbuf_free(pb);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -207,13 +207,11 @@ static err_t pppoe_write(ppp_pcb *ppp, void *ctx, struct pbuf *p) {
|
||||||
pbuf_remove_header(p, 2);
|
pbuf_remove_header(p, 2);
|
||||||
|
|
||||||
ph = ppp_memory_buffer_allocate(ppp->netif->memory_manager, (u16_t)(PPPOE_HEADERLEN), PPP_BUF_HEAP);
|
ph = ppp_memory_buffer_allocate(ppp->netif->memory_manager, (u16_t)(PPPOE_HEADERLEN), PPP_BUF_HEAP);
|
||||||
//ph = pbuf_alloc(PBUF_LINK, (u16_t)(PPPOE_HEADERLEN), PBUF_RAM);
|
|
||||||
if(!ph) {
|
if(!ph) {
|
||||||
LINK_STATS_INC(link.memerr);
|
LINK_STATS_INC(link.memerr);
|
||||||
LINK_STATS_INC(link.proterr);
|
LINK_STATS_INC(link.proterr);
|
||||||
MIB2_STATS_NETIF_INC(ppp->netif, ifoutdiscards);
|
MIB2_STATS_NETIF_INC(ppp->netif, ifoutdiscards);
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -250,7 +248,6 @@ static err_t pppoe_netif_output(ppp_pcb *ppp, void *ctx, struct pbuf *p, u_short
|
||||||
|
|
||||||
/* @todo: try to use pbuf_header() here! */
|
/* @todo: try to use pbuf_header() here! */
|
||||||
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, PPPOE_HEADERLEN + sizeof(protocol), PPP_BUF_HEAP);
|
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, PPPOE_HEADERLEN + sizeof(protocol), PPP_BUF_HEAP);
|
||||||
//pb = pbuf_alloc(PBUF_LINK, PPPOE_HEADERLEN + sizeof(protocol), PBUF_RAM);
|
|
||||||
if(!pb) {
|
if(!pb) {
|
||||||
LINK_STATS_INC(link.memerr);
|
LINK_STATS_INC(link.memerr);
|
||||||
LINK_STATS_INC(link.proterr);
|
LINK_STATS_INC(link.proterr);
|
||||||
|
|
@ -388,7 +385,6 @@ pppoe_disc_input(struct netif *netif, struct pbuf *pb)
|
||||||
/* don't do anything if there is not a single PPPoE instance */
|
/* don't do anything if there is not a single PPPoE instance */
|
||||||
if (pppoe_softc_list == NULL) {
|
if (pppoe_softc_list == NULL) {
|
||||||
ppp_memory_buffer_free(pb);
|
ppp_memory_buffer_free(pb);
|
||||||
//pbuf_free(pb);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -642,7 +638,6 @@ breakbreak:;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
ppp_memory_buffer_free(pb);
|
ppp_memory_buffer_free(pb);
|
||||||
//pbuf_free(pb);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -713,7 +708,6 @@ pppoe_data_input(struct netif *netif, struct pbuf *pb)
|
||||||
|
|
||||||
drop:
|
drop:
|
||||||
ppp_memory_buffer_free(pb);
|
ppp_memory_buffer_free(pb);
|
||||||
//pbuf_free(pb);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static err_t
|
static err_t
|
||||||
|
|
@ -729,7 +723,6 @@ pppoe_output(struct pppoe_softc *sc, struct pbuf *pb)
|
||||||
PPPDEBUG(LOG_ERR, ("pppoe: %c%c%"U16_F": pppoe_output: could not allocate room for Ethernet header\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num));
|
PPPDEBUG(LOG_ERR, ("pppoe: %c%c%"U16_F": pppoe_output: could not allocate room for Ethernet header\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num));
|
||||||
LINK_STATS_INC(link.lenerr);
|
LINK_STATS_INC(link.lenerr);
|
||||||
ppp_memory_buffer_free(pb);
|
ppp_memory_buffer_free(pb);
|
||||||
//pbuf_free(pb);
|
|
||||||
return ERR_BUF;
|
return ERR_BUF;
|
||||||
}
|
}
|
||||||
ethhdr = (struct eth_hdr *)pb->payload;
|
ethhdr = (struct eth_hdr *)pb->payload;
|
||||||
|
|
@ -747,7 +740,6 @@ pppoe_output(struct pppoe_softc *sc, struct pbuf *pb)
|
||||||
res = sc->sc_ethif->linkoutput(sc->sc_ethif, pb);
|
res = sc->sc_ethif->linkoutput(sc->sc_ethif, pb);
|
||||||
|
|
||||||
ppp_memory_buffer_free(pb);
|
ppp_memory_buffer_free(pb);
|
||||||
//pbuf_free(pb);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
@ -779,7 +771,6 @@ pppoe_send_padi(struct pppoe_softc *sc)
|
||||||
|
|
||||||
/* allocate a buffer */
|
/* allocate a buffer */
|
||||||
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, (u16_t)(PPPOE_HEADERLEN + len), PPP_BUF_HEAP);
|
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, (u16_t)(PPPOE_HEADERLEN + len), PPP_BUF_HEAP);
|
||||||
//pb = pbuf_alloc(PBUF_LINK, (u16_t)(PPPOE_HEADERLEN + len), PBUF_RAM);
|
|
||||||
if (!pb) {
|
if (!pb) {
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
|
@ -1001,7 +992,6 @@ pppoe_send_padr(struct pppoe_softc *sc)
|
||||||
PPP_ASSERT("sizeof(struct eth_hdr) + PPPOE_HEADERLEN + len <= 0xffff",
|
PPP_ASSERT("sizeof(struct eth_hdr) + PPPOE_HEADERLEN + len <= 0xffff",
|
||||||
sizeof(struct eth_hdr) + PPPOE_HEADERLEN + len <= 0xffff);
|
sizeof(struct eth_hdr) + PPPOE_HEADERLEN + len <= 0xffff);
|
||||||
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, (u16_t)(PPPOE_HEADERLEN + len), PPP_BUF_HEAP);
|
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, (u16_t)(PPPOE_HEADERLEN + len), PPP_BUF_HEAP);
|
||||||
//pb = pbuf_alloc(PBUF_LINK, (u16_t)(PPPOE_HEADERLEN + len), PBUF_RAM);
|
|
||||||
if (!pb) {
|
if (!pb) {
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
|
@ -1042,7 +1032,6 @@ pppoe_send_padt(struct netif *outgoing_if, u_int session, const u8_t *dest)
|
||||||
u8_t *p;
|
u8_t *p;
|
||||||
|
|
||||||
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, (u16_t)(PPPOE_HEADERLEN), PPP_BUF_HEAP);
|
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, (u16_t)(PPPOE_HEADERLEN), PPP_BUF_HEAP);
|
||||||
//pb = pbuf_alloc(PBUF_LINK, (u16_t)(PPPOE_HEADERLEN), PBUF_RAM);
|
|
||||||
if (!pb) {
|
if (!pb) {
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
|
@ -1052,7 +1041,6 @@ pppoe_send_padt(struct netif *outgoing_if, u_int session, const u8_t *dest)
|
||||||
PPPDEBUG(LOG_ERR, ("pppoe: pppoe_send_padt: could not allocate room for PPPoE header\n"));
|
PPPDEBUG(LOG_ERR, ("pppoe: pppoe_send_padt: could not allocate room for PPPoE header\n"));
|
||||||
LINK_STATS_INC(link.lenerr);
|
LINK_STATS_INC(link.lenerr);
|
||||||
ppp_memory_buffer_free(pb);
|
ppp_memory_buffer_free(pb);
|
||||||
//pbuf_free(pb);
|
|
||||||
return ERR_BUF;
|
return ERR_BUF;
|
||||||
}
|
}
|
||||||
ethhdr = (struct eth_hdr *)pb->payload;
|
ethhdr = (struct eth_hdr *)pb->payload;
|
||||||
|
|
@ -1066,7 +1054,6 @@ pppoe_send_padt(struct netif *outgoing_if, u_int session, const u8_t *dest)
|
||||||
res = outgoing_if->linkoutput(outgoing_if, pb);
|
res = outgoing_if->linkoutput(outgoing_if, pb);
|
||||||
|
|
||||||
ppp_memory_buffer_free(pb);
|
ppp_memory_buffer_free(pb);
|
||||||
//pbuf_free(pb);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
@ -1086,7 +1073,6 @@ pppoe_send_pado(struct pppoe_softc *sc)
|
||||||
/* include hunique */
|
/* include hunique */
|
||||||
len += 2 + 2 + sc->sc_hunique_len;
|
len += 2 + 2 + sc->sc_hunique_len;
|
||||||
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, (u16_t)(PPPOE_HEADERLEN + len), PPP_BUF_HEAP);
|
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, (u16_t)(PPPOE_HEADERLEN + len), PPP_BUF_HEAP);
|
||||||
//pb = pbuf_alloc(PBUF_LINK, (u16_t)(PPPOE_HEADERLEN + len), PBUF_RAM);
|
|
||||||
if (!pb) {
|
if (!pb) {
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
|
@ -1120,7 +1106,6 @@ pppoe_send_pads(struct pppoe_softc *sc)
|
||||||
len += l1;
|
len += l1;
|
||||||
}
|
}
|
||||||
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, (u16_t)(PPPOE_HEADERLEN + len), PPP_BUF_HEAP);
|
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, (u16_t)(PPPOE_HEADERLEN + len), PPP_BUF_HEAP);
|
||||||
//pb = pbuf_alloc(PBUF_LINK, (u16_t)(PPPOE_HEADERLEN + len), PBUF_RAM);
|
|
||||||
if (!pb) {
|
if (!pb) {
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
|
@ -1156,7 +1141,6 @@ pppoe_xmit(struct pppoe_softc *sc, struct pbuf *pb)
|
||||||
PPPDEBUG(LOG_ERR, ("pppoe: %c%c%"U16_F": pppoe_xmit: could not allocate room for PPPoE header\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num));
|
PPPDEBUG(LOG_ERR, ("pppoe: %c%c%"U16_F": pppoe_xmit: could not allocate room for PPPoE header\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num));
|
||||||
LINK_STATS_INC(link.lenerr);
|
LINK_STATS_INC(link.lenerr);
|
||||||
ppp_memory_buffer_free(pb);
|
ppp_memory_buffer_free(pb);
|
||||||
//pbuf_free(pb);
|
|
||||||
return ERR_BUF;
|
return ERR_BUF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -167,13 +167,11 @@ static err_t pppol2tp_write(ppp_pcb *ppp, void *ctx, struct pbuf *p) {
|
||||||
#endif /* MIB2_STATS */
|
#endif /* MIB2_STATS */
|
||||||
|
|
||||||
ph = ppp_memory_buffer_allocate(ppp->netif->memory_manager, (u16_t)(PPPOL2TP_OUTPUT_DATA_HEADER_LEN), PPP_BUF_HEAP);
|
ph = ppp_memory_buffer_allocate(ppp->netif->memory_manager, (u16_t)(PPPOL2TP_OUTPUT_DATA_HEADER_LEN), PPP_BUF_HEAP);
|
||||||
//ph = pbuf_alloc(PBUF_TRANSPORT, (u16_t)(PPPOL2TP_OUTPUT_DATA_HEADER_LEN), PBUF_RAM);
|
|
||||||
if(!ph) {
|
if(!ph) {
|
||||||
LINK_STATS_INC(link.memerr);
|
LINK_STATS_INC(link.memerr);
|
||||||
LINK_STATS_INC(link.proterr);
|
LINK_STATS_INC(link.proterr);
|
||||||
MIB2_STATS_NETIF_INC(ppp->netif, ifoutdiscards);
|
MIB2_STATS_NETIF_INC(ppp->netif, ifoutdiscards);
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -210,7 +208,6 @@ static err_t pppol2tp_netif_output(ppp_pcb *ppp, void *ctx, struct pbuf *p, u_sh
|
||||||
|
|
||||||
/* @todo: try to use pbuf_header() here! */
|
/* @todo: try to use pbuf_header() here! */
|
||||||
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, PPPOL2TP_OUTPUT_DATA_HEADER_LEN + sizeof(protocol), PPP_BUF_HEAP);
|
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, PPPOL2TP_OUTPUT_DATA_HEADER_LEN + sizeof(protocol), PPP_BUF_HEAP);
|
||||||
//pb = pbuf_alloc(PBUF_TRANSPORT, PPPOL2TP_OUTPUT_DATA_HEADER_LEN + sizeof(protocol), PBUF_RAM);
|
|
||||||
if(!pb) {
|
if(!pb) {
|
||||||
LINK_STATS_INC(link.memerr);
|
LINK_STATS_INC(link.memerr);
|
||||||
LINK_STATS_INC(link.proterr);
|
LINK_STATS_INC(link.proterr);
|
||||||
|
|
@ -477,7 +474,6 @@ packet_too_short:
|
||||||
PPPDEBUG(LOG_DEBUG, ("pppol2tp: packet too short: %d\n", p->len));
|
PPPDEBUG(LOG_DEBUG, ("pppol2tp: packet too short: %d\n", p->len));
|
||||||
free_and_return:
|
free_and_return:
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* L2TP Control packet entry point */
|
/* L2TP Control packet entry point */
|
||||||
|
|
@ -821,7 +817,6 @@ static err_t pppol2tp_send_sccrq(pppol2tp_pcb *l2tp) {
|
||||||
|
|
||||||
/* allocate a buffer */
|
/* allocate a buffer */
|
||||||
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, len, PPP_BUF_HEAP);
|
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, len, PPP_BUF_HEAP);
|
||||||
//pb = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM);
|
|
||||||
if (pb == NULL) {
|
if (pb == NULL) {
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
|
@ -917,7 +912,6 @@ static err_t pppol2tp_send_scccn(pppol2tp_pcb *l2tp, u16_t ns) {
|
||||||
|
|
||||||
/* allocate a buffer */
|
/* allocate a buffer */
|
||||||
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, len, PPP_BUF_HEAP);
|
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, len, PPP_BUF_HEAP);
|
||||||
//pb = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM);
|
|
||||||
if (pb == NULL) {
|
if (pb == NULL) {
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
|
@ -965,7 +959,6 @@ static err_t pppol2tp_send_icrq(pppol2tp_pcb *l2tp, u16_t ns) {
|
||||||
|
|
||||||
/* allocate a buffer */
|
/* allocate a buffer */
|
||||||
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, len, PPP_BUF_HEAP);
|
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, len, PPP_BUF_HEAP);
|
||||||
//pb = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM);
|
|
||||||
if (pb == NULL) {
|
if (pb == NULL) {
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
|
@ -1014,7 +1007,6 @@ static err_t pppol2tp_send_iccn(pppol2tp_pcb *l2tp, u16_t ns) {
|
||||||
|
|
||||||
/* allocate a buffer */
|
/* allocate a buffer */
|
||||||
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, len, PPP_BUF_HEAP);
|
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, len, PPP_BUF_HEAP);
|
||||||
//pb = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM);
|
|
||||||
if (pb == NULL) {
|
if (pb == NULL) {
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
|
@ -1062,7 +1054,6 @@ static err_t pppol2tp_send_zlb(pppol2tp_pcb *l2tp, u16_t ns, u16_t nr) {
|
||||||
|
|
||||||
/* allocate a buffer */
|
/* allocate a buffer */
|
||||||
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, len, PPP_BUF_HEAP);
|
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, len, PPP_BUF_HEAP);
|
||||||
//pb = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM);
|
|
||||||
if (pb == NULL) {
|
if (pb == NULL) {
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
|
@ -1092,7 +1083,6 @@ static err_t pppol2tp_send_stopccn(pppol2tp_pcb *l2tp, u16_t ns) {
|
||||||
|
|
||||||
/* allocate a buffer */
|
/* allocate a buffer */
|
||||||
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, len, PPP_BUF_HEAP);
|
pb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, len, PPP_BUF_HEAP);
|
||||||
//pb = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM);
|
|
||||||
if (pb == NULL) {
|
if (pb == NULL) {
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
|
@ -1138,7 +1128,6 @@ static err_t pppol2tp_xmit(pppol2tp_pcb *l2tp, struct pbuf *pb) {
|
||||||
PPPDEBUG(LOG_ERR, ("pppol2tp: pppol2tp_pcb: could not allocate room for L2TP header\n"));
|
PPPDEBUG(LOG_ERR, ("pppol2tp: pppol2tp_pcb: could not allocate room for L2TP header\n"));
|
||||||
LINK_STATS_INC(link.lenerr);
|
LINK_STATS_INC(link.lenerr);
|
||||||
ppp_memory_buffer_free(pb);
|
ppp_memory_buffer_free(pb);
|
||||||
//pbuf_free(pb);
|
|
||||||
return ERR_BUF;
|
return ERR_BUF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1158,7 +1147,6 @@ static err_t pppol2tp_udp_send(pppol2tp_pcb *l2tp, struct pbuf *pb) {
|
||||||
err = udp_sendto(l2tp->udp, pb, &l2tp->remote_ip, l2tp->tunnel_port);
|
err = udp_sendto(l2tp->udp, pb, &l2tp->remote_ip, l2tp->tunnel_port);
|
||||||
}
|
}
|
||||||
ppp_memory_buffer_free(pb);
|
ppp_memory_buffer_free(pb);
|
||||||
//pbuf_free(pb);
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,6 @@ pppos_write(ppp_pcb *ppp, void *ctx, struct pbuf *p)
|
||||||
pool_bufsize = PBUF_POOL_BUFSIZE;
|
pool_bufsize = PBUF_POOL_BUFSIZE;
|
||||||
}
|
}
|
||||||
nb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, pool_bufsize, PPP_BUF_POOL);
|
nb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, pool_bufsize, PPP_BUF_POOL);
|
||||||
//nb = pbuf_alloc(PBUF_RAW, 0, PBUF_POOL);
|
|
||||||
|
|
||||||
if (nb == NULL || nb->len != nb->tot_len) {
|
if (nb == NULL || nb->len != nb->tot_len) {
|
||||||
PPPDEBUG(LOG_WARNING, ("pppos_write[%d]: alloc fail\n", ppp->netif->num));
|
PPPDEBUG(LOG_WARNING, ("pppos_write[%d]: alloc fail\n", ppp->netif->num));
|
||||||
|
|
@ -234,7 +233,6 @@ pppos_write(ppp_pcb *ppp, void *ctx, struct pbuf *p)
|
||||||
}
|
}
|
||||||
|
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -256,7 +254,6 @@ pppos_netif_output(ppp_pcb *ppp, void *ctx, struct pbuf *pb, u16_t protocol)
|
||||||
pool_bufsize = PBUF_POOL_BUFSIZE;
|
pool_bufsize = PBUF_POOL_BUFSIZE;
|
||||||
}
|
}
|
||||||
nb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, pool_bufsize, PPP_BUF_POOL);
|
nb = ppp_memory_buffer_allocate(ppp->netif->memory_manager, pool_bufsize, PPP_BUF_POOL);
|
||||||
// nb = pbuf_alloc(PBUF_RAW, 0, PBUF_POOL);
|
|
||||||
|
|
||||||
if (nb == NULL || nb->len != nb->tot_len) {
|
if (nb == NULL || nb->len != nb->tot_len) {
|
||||||
PPPDEBUG(LOG_WARNING, ("pppos_netif_output[%d]: alloc fail\n", ppp->netif->num));
|
PPPDEBUG(LOG_WARNING, ("pppos_netif_output[%d]: alloc fail\n", ppp->netif->num));
|
||||||
|
|
@ -423,7 +420,6 @@ pppos_input_tcpip(ppp_pcb *ppp, u8_t *s, int l)
|
||||||
err_t err;
|
err_t err;
|
||||||
|
|
||||||
p = ppp_memory_buffer_allocate(ppp->netif->memory_manager, l, PPP_BUF_POOL);
|
p = ppp_memory_buffer_allocate(ppp->netif->memory_manager, l, PPP_BUF_POOL);
|
||||||
//p = pbuf_alloc(PBUF_RAW, l, PBUF_POOL);
|
|
||||||
if (!p) {
|
if (!p) {
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
|
@ -433,7 +429,6 @@ pppos_input_tcpip(ppp_pcb *ppp, u8_t *s, int l)
|
||||||
err = tcpip_inpkt(p, ppp_netif(ppp), pppos_input_sys);
|
err = tcpip_inpkt(p, ppp_netif(ppp), pppos_input_sys);
|
||||||
if (err != ERR_OK) {
|
if (err != ERR_OK) {
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
@ -447,7 +442,6 @@ err_t pppos_input_sys(struct pbuf *p, struct netif *inp) {
|
||||||
pppos_input(ppp, (u8_t*)n->payload, n->len);
|
pppos_input(ppp, (u8_t*)n->payload, n->len);
|
||||||
}
|
}
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
#endif /* !NO_SYS && !PPP_INPROC_IRQ_SAFE */
|
#endif /* !NO_SYS && !PPP_INPROC_IRQ_SAFE */
|
||||||
|
|
@ -565,7 +559,6 @@ pppos_input(ppp_pcb *ppp, u8_t *s, int l)
|
||||||
if (ppp_call_callback(ppp->netif->service_ptr, pppos_input_callback, inp) != ERR_OK) {
|
if (ppp_call_callback(ppp->netif->service_ptr, pppos_input_callback, inp) != ERR_OK) {
|
||||||
PPPDEBUG(LOG_ERR, ("pppos_input[%d]: tcpip_callback() failed, dropping packet\n", ppp->netif->num));
|
PPPDEBUG(LOG_ERR, ("pppos_input[%d]: tcpip_callback() failed, dropping packet\n", ppp->netif->num));
|
||||||
ppp_memory_buffer_free(inp);
|
ppp_memory_buffer_free(inp);
|
||||||
//pbuf_free(inp);
|
|
||||||
LINK_STATS_INC(link.drop);
|
LINK_STATS_INC(link.drop);
|
||||||
MIB2_STATS_NETIF_INC(ppp->netif, ifindiscards);
|
MIB2_STATS_NETIF_INC(ppp->netif, ifindiscards);
|
||||||
}
|
}
|
||||||
|
|
@ -677,8 +670,6 @@ pppos_input(ppp_pcb *ppp, u8_t *s, int l)
|
||||||
#endif /* IP_FORWARD || PPP_IPV6_FORWARD */
|
#endif /* IP_FORWARD || PPP_IPV6_FORWARD */
|
||||||
u16_t pool_bufsize = ppp_memory_buffer_pool_alloc_unit_get(ppp->netif->memory_manager);
|
u16_t pool_bufsize = ppp_memory_buffer_pool_alloc_unit_get(ppp->netif->memory_manager);
|
||||||
pbuf *next_pbuf = ppp_memory_buffer_allocate(ppp->netif->memory_manager, pool_bufsize, PPP_BUF_POOL);
|
pbuf *next_pbuf = ppp_memory_buffer_allocate(ppp->netif->memory_manager, pool_bufsize, PPP_BUF_POOL);
|
||||||
|
|
||||||
//next_pbuf = pbuf_alloc(PBUF_RAW, pbuf_alloc_len, PBUF_POOL);
|
|
||||||
if (next_pbuf == NULL || next_pbuf->len != next_pbuf->tot_len) {
|
if (next_pbuf == NULL || next_pbuf->len != next_pbuf->tot_len) {
|
||||||
/* No free buffers. Drop the input packet and let the
|
/* No free buffers. Drop the input packet and let the
|
||||||
* higher layers deal with it. Continue processing
|
* higher layers deal with it. Continue processing
|
||||||
|
|
@ -739,7 +730,6 @@ drop:
|
||||||
LINK_STATS_INC(link.drop);
|
LINK_STATS_INC(link.drop);
|
||||||
MIB2_STATS_NETIF_INC(ppp->netif, ifindiscards);
|
MIB2_STATS_NETIF_INC(ppp->netif, ifindiscards);
|
||||||
ppp_memory_buffer_free(pb);
|
ppp_memory_buffer_free(pb);
|
||||||
//pbuf_free(pb);
|
|
||||||
}
|
}
|
||||||
#endif /* PPP_INPROC_IRQ_SAFE */
|
#endif /* PPP_INPROC_IRQ_SAFE */
|
||||||
|
|
||||||
|
|
@ -894,7 +884,6 @@ pppos_output_last(pppos_pcb *pppos, err_t err, struct pbuf *nb, u16_t *fcs)
|
||||||
MIB2_STATS_NETIF_INC(ppp->netif, ifoutucastpkts);
|
MIB2_STATS_NETIF_INC(ppp->netif, ifoutucastpkts);
|
||||||
LINK_STATS_INC(link.xmit);
|
LINK_STATS_INC(link.xmit);
|
||||||
ppp_memory_buffer_free(nb);
|
ppp_memory_buffer_free(nb);
|
||||||
//pbuf_free(nb);
|
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
|
|
||||||
failed:
|
failed:
|
||||||
|
|
@ -903,7 +892,6 @@ failed:
|
||||||
LINK_STATS_INC(link.drop);
|
LINK_STATS_INC(link.drop);
|
||||||
MIB2_STATS_NETIF_INC(ppp->netif, ifoutdiscards);
|
MIB2_STATS_NETIF_INC(ppp->netif, ifoutdiscards);
|
||||||
ppp_memory_buffer_free(nb);
|
ppp_memory_buffer_free(nb);
|
||||||
//pbuf_free(nb);
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -534,12 +534,10 @@ static void upap_sauthreq(ppp_pcb *pcb) {
|
||||||
outlen = UPAP_HEADERLEN + 2 * sizeof (u_char) +
|
outlen = UPAP_HEADERLEN + 2 * sizeof (u_char) +
|
||||||
pcb->upap.us_userlen + pcb->upap.us_passwdlen;
|
pcb->upap.us_userlen + pcb->upap.us_passwdlen;
|
||||||
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN +outlen), PPP_BUF_HEAP);
|
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN +outlen), PPP_BUF_HEAP);
|
||||||
//p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN +outlen), PPP_CTRL_PBUF_TYPE);
|
|
||||||
if(NULL == p)
|
if(NULL == p)
|
||||||
return;
|
return;
|
||||||
if(p->tot_len != p->len) {
|
if(p->tot_len != p->len) {
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -573,12 +571,10 @@ static void upap_sresp(ppp_pcb *pcb, u_char code, u_char id, const char *msg, in
|
||||||
|
|
||||||
outlen = UPAP_HEADERLEN + sizeof (u_char) + msglen;
|
outlen = UPAP_HEADERLEN + sizeof (u_char) + msglen;
|
||||||
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN +outlen), PPP_BUF_HEAP);
|
p = ppp_memory_buffer_allocate(pcb->netif->memory_manager, (u16_t)(PPP_HDRLEN +outlen), PPP_BUF_HEAP);
|
||||||
//p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN +outlen), PPP_CTRL_PBUF_TYPE);
|
|
||||||
if(NULL == p)
|
if(NULL == p)
|
||||||
return;
|
return;
|
||||||
if(p->tot_len != p->len) {
|
if(p->tot_len != p->len) {
|
||||||
ppp_memory_buffer_free(p);
|
ppp_memory_buffer_free(p);
|
||||||
//pbuf_free(p);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -633,10 +633,8 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp)
|
||||||
* forwarded (to Ethernet for example).
|
* forwarded (to Ethernet for example).
|
||||||
*/
|
*/
|
||||||
np = ppp_memory_buffer_allocate(pcb->netif->memory_manager, n0->len + cs->cs_hlen, PPP_BUF_POOL);
|
np = ppp_memory_buffer_allocate(pcb->netif->memory_manager, n0->len + cs->cs_hlen, PPP_BUF_POOL);
|
||||||
//np = pbuf_alloc(PBUF_LINK, n0->len + cs->cs_hlen, PBUF_POOL);
|
|
||||||
#else /* IP_FORWARD */
|
#else /* IP_FORWARD */
|
||||||
np = ppp_memory_buffer_allocate(pcb->netif->memory_manager, n0->len + cs->cs_hlen, PPP_BUF_POOL);
|
np = ppp_memory_buffer_allocate(pcb->netif->memory_manager, n0->len + cs->cs_hlen, PPP_BUF_POOL);
|
||||||
//np = pbuf_alloc(PBUF_RAW, n0->len + cs->cs_hlen, PBUF_POOL);
|
|
||||||
#endif /* IP_FORWARD */
|
#endif /* IP_FORWARD */
|
||||||
if(!np) {
|
if(!np) {
|
||||||
PPPDEBUG(LOG_WARNING, ("vj_uncompress_tcp: realign failed\n"));
|
PPPDEBUG(LOG_WARNING, ("vj_uncompress_tcp: realign failed\n"));
|
||||||
|
|
@ -656,7 +654,6 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp)
|
||||||
pbuf_dechain(n0);
|
pbuf_dechain(n0);
|
||||||
}
|
}
|
||||||
ppp_memory_buffer_free(n0);
|
ppp_memory_buffer_free(n0);
|
||||||
//pbuf_free(n0);
|
|
||||||
n0 = np;
|
n0 = np;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -665,7 +662,6 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp)
|
||||||
|
|
||||||
PPP_ASSERT("vj_uncompress_tcp: cs->cs_hlen <= PBUF_POOL_BUFSIZE", cs->cs_hlen <= PBUF_POOL_BUFSIZE);
|
PPP_ASSERT("vj_uncompress_tcp: cs->cs_hlen <= PBUF_POOL_BUFSIZE", cs->cs_hlen <= PBUF_POOL_BUFSIZE);
|
||||||
np = ppp_memory_buffer_allocate(pcb->netif->memory_manager, cs->cs_hlen, PPP_BUF_POOL);
|
np = ppp_memory_buffer_allocate(pcb->netif->memory_manager, cs->cs_hlen, PPP_BUF_POOL);
|
||||||
//np = pbuf_alloc(PBUF_RAW, cs->cs_hlen, PBUF_POOL);
|
|
||||||
if(!np) {
|
if(!np) {
|
||||||
PPPDEBUG(LOG_WARNING, ("vj_uncompress_tcp: prepend failed\n"));
|
PPPDEBUG(LOG_WARNING, ("vj_uncompress_tcp: prepend failed\n"));
|
||||||
goto bad;
|
goto bad;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue