From: Pekka Savola <pekkas@netcore.fi>
To: Michal Ostrowski <mostrows@earthlink.net>
Cc: netdev@vger.kernel.org, ppp-bugs@dp.samba.org
Subject: Re: [PATCH] Advertise PPPoE MTU / avoid memory leak.
Date: Tue, 26 Sep 2006 09:32:39 +0300 (EEST) [thread overview]
Message-ID: <Pine.LNX.4.64.0609260931490.3774@netcore.fi> (raw)
In-Reply-To: <115903262344-git-send-email-mostrows@earthlink.net>
Speaking of PPPoE and MTU, does Linux support recently-published RFC
4638:
Accommodating a Maximum Transit Unit/Maximum Receive Unit (MTU/MRU)
Greater Than 1492 in the
Point-to-Point Protocol over Ethernet (PPPoE)
On Sat, 23 Sep 2006, mostrows@earthlink.net wrote:
> PPPoE must advertise the underlying device's MTU via the ppp channel
> descriptor structure, as multilink functionality depends on it.
>
> __pppoe_xmit must free any skb it allocates if there is an error
> submitting the skb downstream.
>
> Signed-off-by: Michal Ostrowski <mostrows@earthlink.net>
> ---
> drivers/net/pppoe.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
> index 475dc93..b4dc516 100644
> --- a/drivers/net/pppoe.c
> +++ b/drivers/net/pppoe.c
> @@ -600,6 +600,7 @@ static int pppoe_connect(struct socket *
> po->chan.hdrlen = (sizeof(struct pppoe_hdr) +
> dev->hard_header_len);
>
> + po->chan.mtu = dev->mtu - sizeof(struct pppoe_hdr);
> po->chan.private = sk;
> po->chan.ops = &pppoe_chan_ops;
>
> @@ -831,7 +832,7 @@ static int __pppoe_xmit(struct sock *sk,
> struct pppoe_hdr *ph;
> int headroom = skb_headroom(skb);
> int data_len = skb->len;
> - struct sk_buff *skb2;
> + struct sk_buff *skb2 = NULL;
>
> if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED))
> goto abort;
> @@ -887,6 +888,8 @@ static int __pppoe_xmit(struct sock *sk,
> return 1;
>
> abort:
> + if (skb2)
> + kfree_skb(skb2);
> return 0;
> }
>
>
--
Pekka Savola "You each name yourselves king, yet the
Netcore Oy kingdom bleeds."
Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings
next prev parent reply other threads:[~2006-09-26 6:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-23 17:30 [PATCH] Advertise PPPoE MTU / avoid memory leak mostrows
2006-09-23 21:56 ` David Miller
2006-09-24 12:29 ` Michal Ostrowski
2006-09-25 1:41 ` David Miller
2006-09-25 18:16 ` Michal Ostrowski
2006-09-26 6:32 ` Pekka Savola [this message]
2006-09-27 13:53 ` Michal Ostrowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0609260931490.3774@netcore.fi \
--to=pekkas@netcore.fi \
--cc=mostrows@earthlink.net \
--cc=netdev@vger.kernel.org \
--cc=ppp-bugs@dp.samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).