pktgen: fix UDP checksum computation
commit7744b5f3693cc06695cb9d6667671c790282730f
authorSabrina Dubroca <sd@queasysnail.net>
Wed, 4 Feb 2015 22:08:50 +0000 (4 23:08 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Feb 2015 23:41:34 +0000 (5 15:41 -0800)
tree5c444515404a89170ab1b10c353682a5573d9024
parentc58da4c659803ac12eca5275c8a7064222adb4c7
pktgen: fix UDP checksum computation

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>
net/core/pktgen.c