From bcfaeca3734da53c31705e37c1f072be8b87c4f7 Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Sun, 12 Apr 2015 20:08:01 +0200 Subject: [PATCH] PPP, PPPoE, removed unnecessary single pbuf Removed ppp_singlebuf() in pppoe_data_input(), chained pbuf are perfectly acceptable for IP data and we are currently supporting them perfectly for PPPoS. The PPP stack itself (LCP, IPCP et al.) does not support chained pbuf and is already calling ppp_singlebuf() just before passing packet to the protocol handler. --- src/netif/ppp/pppoe.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/netif/ppp/pppoe.c b/src/netif/ppp/pppoe.c index 2394baa7..0e36651c 100644 --- a/src/netif/ppp/pppoe.c +++ b/src/netif/ppp/pppoe.c @@ -677,8 +677,6 @@ pppoe_data_input(struct netif *netif, struct pbuf *pb) goto drop; } - pb = ppp_singlebuf (pb); - if (pb->len < sizeof(*ph)) { PPPDEBUG(LOG_DEBUG, ("pppoe_data_input: could not get PPPoE header\n")); goto drop; @@ -716,7 +714,7 @@ pppoe_data_input(struct netif *netif, struct pbuf *pb) sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, pb->len, plen)); - if (pb->len < plen) { + if (pb->tot_len < plen) { goto drop; }