Fix UDP-Lite checksum verification bug introduced with r40387 and reported by "answer" via http://ask.wireshark.org/questions/11798/is-udp-lite-checksum-correct-ipv6

There is a difference between the UDP and UDP-Lite pseudo header that wasn't realized when r40387 was committed.  Details of the difference in http://tools.ietf.org/html/rfc3828#section-3.2

svn path=/trunk/; revision=43187
This commit is contained in:
Chris Maynard 2012-06-10 19:43:40 +00:00
parent 08807fc48d
commit 339bedb75c
1 changed files with 8 additions and 2 deletions

View File

@ -462,12 +462,18 @@ dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 ip_proto)
switch (pinfo->src.type) {
case AT_IPv4:
phdr[0] = g_htonl((ip_proto<<16) | udph->uh_ulen);
if (ip_proto == IP_PROTO_UDP)
phdr[0] = g_htonl((ip_proto<<16) | udph->uh_ulen);
else
phdr[0] = g_htonl((ip_proto<<16) | reported_len);
cksum_vec[2].len = 4;
break;
case AT_IPv6:
phdr[0] = g_htonl(udph->uh_ulen);
if (ip_proto == IP_PROTO_UDP)
phdr[0] = g_htonl(udph->uh_ulen);
else
phdr[0] = g_htonl(reported_len);
phdr[1] = g_htonl(ip_proto);
cksum_vec[2].len = 8;
break;