[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <115903262344-git-send-email-mostrows@earthlink.net>
Date: Sat, 23 Sep 2006 12:30:23 -0500
From: mostrows@...thlink.net
To: linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
ppp-bugs@...samba.org
Cc: Michal Ostrowski <mostrows@...thlink.net>
Subject: [PATCH] Advertise PPPoE MTU / avoid memory leak.
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@...thlink.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;
}
--
1.4.1.1
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists