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>
This commit is contained in:
Rémi Denis-Courmont 2008-11-16 19:48:49 -08:00 committed by David S. Miller
parent eb7c3adb1c
commit ebfe92ca65
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}