* [PATCH net-next] net: pppoe: use correct MTU when using Multilink PPP with PPPoE
@ 2014-07-11 7:09 Christoph Schulz
2014-07-11 21:14 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Christoph Schulz @ 2014-07-11 7:09 UTC (permalink / raw)
To: netdev; +Cc: linux-ppp, mostrows
From: Christoph Schulz <develop@kristov.de>
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. If we
don't subtract 2 bytes (which corresponds to the PPP protocol number), the
payload becomes 1-2 bytes too big (1 byte if PPP protocol compression is
used, 2 otherwise), which causes the generated Ethernet packets to be dropped.
This is due to code in ppp_mp_explode() which says:
/*
* 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);
This is correct, but the pppoe module does not account for it and includes
the 2-byte PPP protocol field into the computed MTU, which is wrong. This
error only manifests itself when using Multilink PPP, as otherwise the channel
MTU is not used anywhere.
The bug was introduced in commit c9aa6895371b2a257401f59d3393c9f7ac5a8698
("[PPPOE]: Advertise PPPoE MTU") from the very beginning. This patch applies
to 3.10 upwards but the fix can be applied (with minor modifications) to
kernels as old as 2.6.32.
Signed-off-by: Christoph Schulz <develop@kristov.de>
---
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;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: pppoe: use correct MTU when using Multilink PPP with PPPoE
2014-07-11 7:09 [PATCH net-next] net: pppoe: use correct MTU when using Multilink PPP with PPPoE Christoph Schulz
@ 2014-07-11 21:14 ` David Miller
2014-07-12 22:57 ` Christoph Schulz
0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2014-07-11 21:14 UTC (permalink / raw)
To: develop; +Cc: netdev, linux-ppp, mostrows
Bug fixes like these should be targetted at 'net' not 'net-next'.
Please fix your subjects, number your patches, provides a "[PATCH 0/N]"
header posting explaining your changes at a high level, and resubmit
everything.
Thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: pppoe: use correct MTU when using Multilink PPP with PPPoE
2014-07-11 21:14 ` David Miller
@ 2014-07-12 22:57 ` Christoph Schulz
0 siblings, 0 replies; 3+ messages in thread
From: Christoph Schulz @ 2014-07-12 22:57 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-ppp, mostrows
Hello!
Am 11.07.2014 23:14, schrieb David Miller:
>
> Bug fixes like these should be targetted at 'net' not 'net-next'.
>
> Please fix your subjects, number your patches, provides a "[PATCH 0/N]"
> header posting explaining your changes at a high level, and resubmit
> everything.
[x] Done.
I hope that everything is correct now with this patch. (I will resubmit
my other two patches soon.)
Best regards,
Christoph Schulz
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-07-12 22:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-11 7:09 [PATCH net-next] net: pppoe: use correct MTU when using Multilink PPP with PPPoE Christoph Schulz
2014-07-11 21:14 ` David Miller
2014-07-12 22:57 ` Christoph Schulz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).