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-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ebfe92ca65c780334bdf847ddc4eca15835bd9c0;p=linux-beck.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 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; }