Commit 05aebe2e authored by Daniel Turull's avatar Daniel Turull Committed by David S. Miller

pktgen: bug fix in transmission headers with frags=0

(bug introduced by commit 26ad7879
(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: default avatarDaniel Turull <daniel.turull@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
parent 4e75db2e
...@@ -2620,8 +2620,7 @@ static void pktgen_finalize_skb(struct pktgen_dev *pkt_dev, struct sk_buff *skb, ...@@ -2620,8 +2620,7 @@ static void pktgen_finalize_skb(struct pktgen_dev *pkt_dev, struct sk_buff *skb,
datalen -= sizeof(*pgh); datalen -= sizeof(*pgh);
if (pkt_dev->nfrags <= 0) { if (pkt_dev->nfrags <= 0) {
pgh = (struct pktgen_hdr *)skb_put(skb, datalen); memset(skb_put(skb, datalen), 0, datalen);
memset(pgh + 1, 0, datalen);
} else { } else {
int frags = pkt_dev->nfrags; int frags = pkt_dev->nfrags;
int i, len; int i, len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment