Message ID | 1450312601-4287-1-git-send-email-kamal@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 870046d..04d0e35 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -2147,7 +2147,8 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg) tp_len = tpacket_fill_skb(po, skb, ph, dev, size_max, proto, addr, hlen); - if (tp_len > dev->mtu + dev->hard_header_len) { + if (likely(tp_len >= 0) && + tp_len > dev->mtu + dev->hard_header_len) { struct ethhdr *ehdr; /* Earlier code assumed this would be a VLAN pkt, * double-check this now that we have the actual