diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/packet/af_packet.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index c7c42eb617ef..ed458b315ef4 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -2403,7 +2403,8 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg) | |||
2403 | } | 2403 | } |
2404 | tp_len = tpacket_fill_skb(po, skb, ph, dev, size_max, proto, | 2404 | tp_len = tpacket_fill_skb(po, skb, ph, dev, size_max, proto, |
2405 | addr, hlen); | 2405 | addr, hlen); |
2406 | if (tp_len > dev->mtu + dev->hard_header_len) { | 2406 | if (likely(tp_len >= 0) && |
2407 | tp_len > dev->mtu + dev->hard_header_len) { | ||
2407 | struct ethhdr *ehdr; | 2408 | struct ethhdr *ehdr; |
2408 | /* Earlier code assumed this would be a VLAN pkt, | 2409 | /* Earlier code assumed this would be a VLAN pkt, |
2409 | * double-check this now that we have the actual | 2410 | * double-check this now that we have the actual |