mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-27 12:35:26 +00:00
PPP, PPPoL2TP: skip address & flags for PPP control packets
This is already what we inherently have always done for IPv4/IPv6 packets, so it works. Receivers must handle both cases anyway because both behaviors are seen in the wild.
This commit is contained in:
parent
a494b990da
commit
72d9132ecf
@ -172,6 +172,9 @@ static err_t pppol2tp_write(ppp_pcb *ppp, void *ctx, struct pbuf *p) {
|
|||||||
LWIP_UNUSED_ARG(ppp);
|
LWIP_UNUSED_ARG(ppp);
|
||||||
#endif /* MIB2_STATS */
|
#endif /* MIB2_STATS */
|
||||||
|
|
||||||
|
/* skip address & flags */
|
||||||
|
pbuf_remove_header(p, 2);
|
||||||
|
|
||||||
ph = pbuf_alloc(PBUF_TRANSPORT, (u16_t)(PPPOL2TP_OUTPUT_DATA_HEADER_LEN), PBUF_RAM);
|
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);
|
||||||
@ -463,8 +466,16 @@ static void pppol2tp_input(void *arg, struct udp_pcb *pcb, struct pbuf *p, const
|
|||||||
/*
|
/*
|
||||||
* skip address & flags if necessary
|
* skip address & flags if necessary
|
||||||
*
|
*
|
||||||
* RFC 2661 does not specify whether the PPP frame in the L2TP payload should
|
* RFC 2661 (L2TPv2) does not specify whether the PPP frame in the L2TP payload
|
||||||
* have a HDLC header or not. We handle both cases for compatibility.
|
* should have a HDLC header or not, both behaviors are seen in the wild.
|
||||||
|
*
|
||||||
|
* On the other hand, L2TPv3 draft-ietf-l2tpext-l2tp-ppp versions 00 and 01 say
|
||||||
|
* it must be included, versions 02 to 05 say it must be omitted, and versions
|
||||||
|
* 06 and onwards say it should be omitted so it changed along the path when
|
||||||
|
* L2TPv3 was designed. Latest versions state that receivers must handle both
|
||||||
|
* cases.
|
||||||
|
*
|
||||||
|
* We handle both cases for compatibility.
|
||||||
*/
|
*/
|
||||||
if (p->len >= 2) {
|
if (p->len >= 2) {
|
||||||
GETSHORT(hflags, inp);
|
GETSHORT(hflags, inp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user