[net-next] pktgen: Use ip_send_check() to compute checksum

Submitted by Thomas Graf on July 25, 2013, 12:08 p.m.

Details

Message ID 54f9ca8fb7748c23eec49ad0fa055f2036cde5b7.1374753893.git.tgraf@suug.ch
State Accepted
Delegated to: David Miller
Headers show

Commit Message

Thomas Graf July 25, 2013, 12:08 p.m.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
---
 net/core/pktgen.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 929eb7b..2b3a74e 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2755,8 +2755,7 @@  static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
 	iph->frag_off = 0;
 	iplen = 20 + 8 + datalen;
 	iph->tot_len = htons(iplen);
-	iph->check = 0;
-	iph->check = ip_fast_csum((void *)iph, iph->ihl);
+	ip_send_check(iph);
 	skb->protocol = protocol;
 	skb->dev = odev;
 	skb->pkt_type = PACKET_HOST;