tools/pktgen: Setup header length properly
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 1 Aug 2012 03:24:53 +0000 (11:24 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 1 Aug 2012 03:24:53 +0000 (11:24 +0800)
tools/tools/netrate/pktgen/pktgen.c

index 31e67f6..1d1dde2 100644 (file)
@@ -402,6 +402,8 @@ pktgen_udp_thread1(void *arg)
                                       ui->ui_dst.s_addr, psum);
                m->m_pkthdr.csum_flags = (CSUM_IP | CSUM_UDP);
                m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum);
+               m->m_pkthdr.csum_iphlen = sizeof(struct ip);
+               m->m_pkthdr.csum_thlen = sizeof(struct udphdr);
 
                ip = (struct ip *)ui;
                ip->ip_len = ip_len;