diff options
author | Daniel Turull <daniel.turull@gmail.com> | 2011-03-14 13:47:40 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-14 13:47:40 -0700 |
commit | 05aebe2e5d009314a1d9b47ad9cda59ccb57d76d (patch) | |
tree | bd448f392fbc522034f51e032f5f25bc87951a38 /net | |
parent | 4e75db2e8ff2c97762e87f61f54d7cdeaab1a6b0 (diff) | |
download | linux-05aebe2e5d009314a1d9b47ad9cda59ccb57d76d.tar.bz2 |
pktgen: bug fix in transmission headers with frags=0
(bug introduced by commit 26ad787962ef84677a48c560
(pktgen: speedup fragmented skbs)
The headers of pktgen were incorrectly added in a pktgen packet
without frags (frags=0). There was an offset in the pktgen headers.
The cause was in reusing the pgh variable as a return variable in skb_put
when adding the payload to the skb.
Signed-off-by: Daniel Turull <daniel.turull@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/pktgen.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index f0aec6c39ecd..0c55eaa70e39 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -2620,8 +2620,7 @@ static void pktgen_finalize_skb(struct pktgen_dev *pkt_dev, struct sk_buff *skb, datalen -= sizeof(*pgh); if (pkt_dev->nfrags <= 0) { - pgh = (struct pktgen_hdr *)skb_put(skb, datalen); - memset(pgh + 1, 0, datalen); + memset(skb_put(skb, datalen), 0, datalen); } else { int frags = pkt_dev->nfrags; int i, len; |