summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Denis-Courmont <remi.denis-courmont@nokia.com>2008-11-17 06:48:49 +0300
committerDavid S. Miller <davem@davemloft.net>2008-11-17 06:48:49 +0300
commitebfe92ca65c780334bdf847ddc4eca15835bd9c0 (patch)
tree6def944664e96f8394bcc9e268c5ee8e9d64ee16
parenteb7c3adb1ca92450870dbb0d347fc986cd5e2af4 (diff)
downloadlinux-ebfe92ca65c780334bdf847ddc4eca15835bd9c0.tar.xz
Phonet: refuse to send bigger than MTU packets
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/phonet/af_phonet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
index defeb7a0d502..7ab30f668b5a 100644
--- a/net/phonet/af_phonet.c
+++ b/net/phonet/af_phonet.c
@@ -144,8 +144,8 @@ static int pn_send(struct sk_buff *skb, struct net_device *dev,
struct phonethdr *ph;
int err;
- if (skb->len + 2 > 0xffff) {
- /* Phonet length field would overflow */
+ if (skb->len + 2 > 0xffff /* Phonet length field limit */ ||
+ skb->len + sizeof(struct phonethdr) > dev->mtu) {
err = -EMSGSIZE;
goto drop;
}