]> git.ipfire.org Git - people/ms/linux.git/commit
pktgen: fix UDP checksum computation
authorSabrina Dubroca <sd@queasysnail.net>
Wed, 4 Feb 2015 22:08:50 +0000 (23:08 +0100)
committerSasha Levin <sasha.levin@oracle.com>
Sat, 14 Mar 2015 19:37:09 +0000 (15:37 -0400)
commit76936e5d2a4cdbe18caae900f300d752ea46886b
treefb5a388cc917273c76aa51183f3b39c165fe0611
parent5cd5724b91933ba6985e2094bf7eacb4ce081b53
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: Sasha Levin <sasha.levin@oracle.com>
net/core/pktgen.c