Commit ebfe92ca authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont Committed by David S. Miller

Phonet: refuse to send bigger than MTU packets

Signed-off-by: default avatarRémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent eb7c3adb
...@@ -144,8 +144,8 @@ static int pn_send(struct sk_buff *skb, struct net_device *dev, ...@@ -144,8 +144,8 @@ static int pn_send(struct sk_buff *skb, struct net_device *dev,
struct phonethdr *ph; struct phonethdr *ph;
int err; int err;
if (skb->len + 2 > 0xffff) { if (skb->len + 2 > 0xffff /* Phonet length field limit */ ||
/* Phonet length field would overflow */ skb->len + sizeof(struct phonethdr) > dev->mtu) {
err = -EMSGSIZE; err = -EMSGSIZE;
goto drop; goto drop;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment