]> git.hungrycats.org Git - linux/commit
pktgen: fix UDP checksum computation
authorSabrina Dubroca <sd@queasysnail.net>
Wed, 4 Feb 2015 22:08:50 +0000 (23:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2015 13:10:48 +0000 (14:10 +0100)
commit18bb5d3023fbf4331128c67df627cd88ab47911b
treeb63fd64e5608a22a6b7c95821f448d96805a6850
parent5484abd9b6a0449ccca3875dc3eee4ad7e6ebcdd
pktgen: fix UDP checksum computation

[ Upstream commit 7744b5f3693cc06695cb9d6667671c790282730f ]

This patch fixes two issues in UDP checksum computation in pktgen.

First, the pseudo-header uses the source and destination IP
addresses. Currently, the ports are used for IPv4.

Second, the UDP checksum covers both header and data.  So we need to
generate the data earlier (move pktgen_finalize_skb up), and compute
the checksum for UDP header + data.

Fixes: c26bf4a51308c ("pktgen: Add UDPCSUM flag to support UDP checksums")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/core/pktgen.c