diff options
Diffstat (limited to 'net/core/pktgen.c')
-rw-r--r-- | net/core/pktgen.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 3827f881f429..da16f8fd1494 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -1860,13 +1860,14 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev, | |||
1860 | */ | 1860 | */ |
1861 | mod_cur_headers(pkt_dev); | 1861 | mod_cur_headers(pkt_dev); |
1862 | 1862 | ||
1863 | skb = alloc_skb(pkt_dev->cur_pkt_size + 64 + 16, GFP_ATOMIC); | 1863 | datalen = (odev->hard_header_len + 16) & ~0xf; |
1864 | skb = alloc_skb(pkt_dev->cur_pkt_size + 64 + datalen, GFP_ATOMIC); | ||
1864 | if (!skb) { | 1865 | if (!skb) { |
1865 | sprintf(pkt_dev->result, "No memory"); | 1866 | sprintf(pkt_dev->result, "No memory"); |
1866 | return NULL; | 1867 | return NULL; |
1867 | } | 1868 | } |
1868 | 1869 | ||
1869 | skb_reserve(skb, 16); | 1870 | skb_reserve(skb, datalen); |
1870 | 1871 | ||
1871 | /* Reserve for ethernet and IP header */ | 1872 | /* Reserve for ethernet and IP header */ |
1872 | eth = (__u8 *) skb_push(skb, 14); | 1873 | eth = (__u8 *) skb_push(skb, 14); |