]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pktgen: fix UDP checksum computation
authorSabrina Dubroca <sd@queasysnail.net>
Wed, 4 Feb 2015 22:08:50 +0000 (23:08 +0100)
committerJiri Slaby <jslaby@suse.cz>
Thu, 12 Mar 2015 09:06:22 +0000 (10:06 +0100)
commit7097d6432409cef7ad4996e580eff45025183c99
treedf08bbaf5c4ee8c2706a03ac60c8b238ef50545c
parent7baf34ccb79c727f55b41cc4e5f2bdb40dcf5010
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: Jiri Slaby <jslaby@suse.cz>
net/core/pktgen.c