From: Rémi Denis-Courmont Date: Mon, 17 Nov 2008 03:48:49 +0000 (-0800) Subject: Phonet: refuse to send bigger than MTU packets X-Git-Tag: v2.6.28-rc6~62^2~2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ebfe92ca65c780334bdf847ddc4eca15835bd9c0;p=linux-2.6-omap-h63xx.git Phonet: refuse to send bigger than MTU packets Signed-off-by: Rémi Denis-Courmont Signed-off-by: David S. Miller --- diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c index defeb7a0d50..7ab30f668b5 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; }