Message ID | 53C1BC5B.9010004@kristov.de |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Christoph Schulz <develop@kristov.de> Date: Sun, 13 Jul 2014 00:53:15 +0200 > The PPP channel MTU is used with Multilink PPP when ppp_mp_explode() (see > ppp_generic module) tries to determine how big a fragment might be. According > to RFC 1661, the MTU excludes the 2-byte PPP protocol field, see the > corresponding comment and code in ppp_mp_explode(): > > /* > * hdrlen includes the 2-byte PPP protocol field, but the > * MTU counts only the payload excluding the protocol field. > * (RFC1661 Section 2) > */ > mtu = pch->chan->mtu - (hdrlen - 2); > > However, the pppoe module *does* include the PPP protocol field in the channel > MTU, which is wrong as it causes the PPP payload to be 1-2 bytes too big under > certain circumstances (one byte if PPP protocol compression is used, two > otherwise), causing the generated Ethernet packets to be dropped. So the pppoe > module has to subtract two bytes from the channel MTU. This error only > manifests itself when using Multilink PPP, as otherwise the channel MTU is not > used anywhere. Applied and queued up for -stable, thank you. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c index 2ea7efd..6c9c16d 100644 --- a/drivers/net/ppp/pppoe.c +++ b/drivers/net/ppp/pppoe.c @@ -675,7 +675,7 @@ static int pppoe_connect(struct socket *sock, struct sockaddr *uservaddr, po->chan.hdrlen = (sizeof(struct pppoe_hdr) + dev->hard_header_len); - po->chan.mtu = dev->mtu - sizeof(struct pppoe_hdr); + po->chan.mtu = dev->mtu - sizeof(struct pppoe_hdr) - 2; po->chan.private = sk; po->chan.ops = &pppoe_chan_ops;