projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e048a37
)
[PKTGEN]: Respect hard_header_len of device.
author
David S. Miller
<davem@sunset.davemloft.net>
Wed, 18 Jan 2006 22:19:10 +0000
(14:19 -0800)
committer
David S. Miller
<davem@sunset.davemloft.net>
Wed, 18 Jan 2006 22:19:10 +0000
(14:19 -0800)
Don't assume 16.
Found by Ben Greear.
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/pktgen.c
patch
|
blob
|
blame
|
history
diff --git
a/net/core/pktgen.c
b/net/core/pktgen.c
index 3827f881f4292312b9eba8eb30f81b915d96b4e9..da16f8fd1494e9203c2d4bd3dbc3ef06ffe8594e 100644
(file)
--- 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,
*/
mod_cur_headers(pkt_dev);
- skb = alloc_skb(pkt_dev->cur_pkt_size + 64 + 16, GFP_ATOMIC);
+ datalen = (odev->hard_header_len + 16) & ~0xf;
+ skb = alloc_skb(pkt_dev->cur_pkt_size + 64 + datalen, GFP_ATOMIC);
if (!skb) {
sprintf(pkt_dev->result, "No memory");
return NULL;
}
- skb_reserve(skb,
16
);
+ skb_reserve(skb,
datalen
);
/* Reserve for ethernet and IP header */
eth = (__u8 *) skb_push(skb, 14);