FreeBSD Bugzilla – Attachment 140539 Details for
Bug 187149
[patch] [netmap] fix netmap's pkt-gen behavior with IP addresses or port range
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.19 KB, created by
olivier
on 2014-02-28 21:10:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
olivier
Created:
2014-02-28 21:10:00 UTC
Size:
1.19 KB
patch
obsolete
>Index: tools/tools/netmap/pkt-gen.c >=================================================================== >--- tools/tools/netmap/pkt-gen.c (revision 262618) >+++ tools/tools/netmap/pkt-gen.c (working copy) >@@ -546,6 +546,7 @@ > { > uint32_t a; > uint16_t p; >+ struct ether_header *eh = &pkt->eh; > struct ip *ip = &pkt->ip; > struct udphdr *udp = &pkt->udp; > >@@ -580,6 +581,25 @@ > ip->ip_dst.s_addr = htonl(g->dst_ip.start); > } while (0); > // update checksum >+ /* Missing code here ? the comment "update checksum" should be followed >+ * by updating IP & UDP checksum. I will try to fix by simply copy/past >+ * checksum code from initialize_packet function */ >+ >+ ip->ip_sum = 0; >+ ip->ip_sum = wrapsum(checksum(ip, sizeof(*ip), 0)); >+ >+ /* UDP checksum */ >+ uint16_t paylen = g->pkt_size - sizeof(*eh) - sizeof(struct ip); >+ udp->uh_sum = 0; >+ udp->uh_sum = wrapsum(checksum(udp, sizeof(*udp), >+ checksum(pkt->body, >+ paylen - sizeof(*udp), >+ checksum(&ip->ip_src, 2 * sizeof(ip->ip_src), >+ IPPROTO_UDP + (u_int32_t)ntohs(udp->uh_ulen) >+ ) >+ ) >+ )); >+ > } > > /*
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 187149
:
140539
|
157306
|
157307