Skip to content

Commit

Permalink
Phonet: refuse to send bigger than MTU packets
Browse files Browse the repository at this point in the history
Signed-off-by: Rémi Denis-Courmont <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Rémi Denis-Courmont authored and davem330 committed Nov 17, 2008
1 parent eb7c3ad commit ebfe92c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/phonet/af_phonet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ebfe92c

Please sign in to comment.