From bc99f75b5369cef61f88f575ea6bce400e4aa218 Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Sun, 12 Apr 2015 22:00:43 +0200 Subject: [PATCH] PPP, PPPoL2TP, removed unnecessary single pbuf Removed ppp_singlebuf() in pppol2tp_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. Added ppp_singlebuf() in pppol2tp_dispatch_control_packet() because we do not support chained pbuf in L2TP control packet. --- src/netif/ppp/pppol2tp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netif/ppp/pppol2tp.c b/src/netif/ppp/pppol2tp.c index c06c303f..684ae590 100644 --- a/src/netif/ppp/pppol2tp.c +++ b/src/netif/ppp/pppol2tp.c @@ -376,7 +376,6 @@ static void pppol2tp_input(void *arg, struct udp_pcb *pcb, struct pbuf *p, const } /* printf("-----------\nL2TP INPUT, %d\n", p->len); */ - p = ppp_singlebuf(p); /* L2TP header */ if (p->len < sizeof(hflags) + sizeof(tunnel_id) + sizeof(session_id) ) { @@ -519,6 +518,7 @@ static void pppol2tp_dispatch_control_packet(pppol2tp_pcb *l2tp, u16_t port, str return; } + p = ppp_singlebuf(p); inp = (u8_t*)p->payload; /* Decode AVPs */ while (p->len > 0) {