aboutsummaryrefslogtreecommitdiffstats
path: root/net/phonet/af_phonet.c
diff options
context:
space:
mode:
authorRémi Denis-Courmont <remi.denis-courmont@nokia.com>2008-11-16 22:48:49 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-16 22:48:49 -0500
commitebfe92ca65c780334bdf847ddc4eca15835bd9c0 (patch)
tree6def944664e96f8394bcc9e268c5ee8e9d64ee16 /net/phonet/af_phonet.c
parenteb7c3adb1ca92450870dbb0d347fc986cd5e2af4 (diff)
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>
Diffstat (limited to 'net/phonet/af_phonet.c')
-rw-r--r--net/phonet/af_phonet.c4
1 files changed, 2 insertions, 2 deletions
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,
144 struct phonethdr *ph; 144 struct phonethdr *ph;
145 int err; 145 int err;
146 146
147 if (skb->len + 2 > 0xffff) { 147 if (skb->len + 2 > 0xffff /* Phonet length field limit */ ||
148 /* Phonet length field would overflow */ 148 skb->len + sizeof(struct phonethdr) > dev->mtu) {
149 err = -EMSGSIZE; 149 err = -EMSGSIZE;
150 goto drop; 150 goto drop;
151 } 151 }