mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-27 12:35:26 +00:00
PPP: remove ppp_singlebuf
We don't have to keep a helper function just for the sake of a PBUF_RAW constant. Inline ppp_singlebuf function. Signed-off-by: Sylvain Rochet <gradator@gradator.net>
This commit is contained in:
parent
3e909bafa8
commit
4171f39a72
@ -406,9 +406,6 @@ void ppp_link_end(ppp_pcb *pcb);
|
||||
/* function called to process input packet */
|
||||
void ppp_input(ppp_pcb *pcb, struct pbuf *pb);
|
||||
|
||||
/* helper function, merge a pbuf chain into one pbuf */
|
||||
struct pbuf *ppp_singlebuf(struct pbuf *p);
|
||||
|
||||
|
||||
/*
|
||||
* Functions called by PPP protocols.
|
||||
|
@ -923,7 +923,7 @@ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) {
|
||||
*/
|
||||
for (i = 0; (protp = protocols[i]) != NULL; ++i) {
|
||||
if (protp->protocol == protocol) {
|
||||
pb = ppp_singlebuf(pb);
|
||||
pb = pbuf_coalesce(pb, PBUF_RAW);
|
||||
(*protp->input)(pcb, (u8_t*)pb->payload, pb->len);
|
||||
goto out;
|
||||
}
|
||||
@ -971,11 +971,6 @@ out:
|
||||
pbuf_free(pb);
|
||||
}
|
||||
|
||||
/* merge a pbuf chain into one pbuf */
|
||||
struct pbuf *ppp_singlebuf(struct pbuf *p) {
|
||||
return pbuf_coalesce(p, PBUF_RAW);
|
||||
}
|
||||
|
||||
/*
|
||||
* Write a pbuf to a ppp link, only used from PPP functions
|
||||
* to send PPP packets.
|
||||
|
@ -394,7 +394,7 @@ pppoe_disc_input(struct netif *netif, struct pbuf *pb)
|
||||
return;
|
||||
}
|
||||
|
||||
pb = ppp_singlebuf(pb);
|
||||
pb = pbuf_coalesce(pb, PBUF_RAW);
|
||||
|
||||
if (pb->len < sizeof(*ethhdr)) {
|
||||
goto done;
|
||||
|
@ -507,7 +507,7 @@ static void pppol2tp_dispatch_control_packet(pppol2tp_pcb *l2tp, u16_t port, str
|
||||
return;
|
||||
}
|
||||
|
||||
p = ppp_singlebuf(p);
|
||||
p = pbuf_coalesce(p, PBUF_RAW);
|
||||
inp = (u8_t*)p->payload;
|
||||
/* Decode AVPs */
|
||||
while (p->len > 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user