6LoWPAN: Less scary display if UDP checksum is elided

Set the 'recomputed' checksum to 0xffff instead of 0 so that the UDP
dissector does not show an 'Illegal Checksum value (0)' PI_ERROR.

Bug 14458

Change-Id: I0fba0979be5a5b2957a7cec98c0df7996491d3b5
Reviewed-on: https://code.wireshark.org/review/26052
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
Robert Sauter 2018-02-23 16:10:27 +01:00 committed by Stig Bjørlykke
parent 389a680cf7
commit 87dfaa72cf
1 changed files with 5 additions and 3 deletions

View File

@ -2457,7 +2457,8 @@ dissect_6lowpan_iphc_nhc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi
offset += 2;
}
else {
udp.checksum = 0;
/* Checksum must be != 0 or the UDP dissector will flag the packet with a PI_ERROR */
udp.checksum = 0xffff;
}
/* Compute the datagram length. */
@ -2475,7 +2476,7 @@ dissect_6lowpan_iphc_nhc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi
* disallows sending UDP datagrams without checksums. Likewise, 6LoWPAN
* requires that we recompute the checksum.
*
* If the datagram is incomplete, then leave the checksum at 0.
* If the datagram is incomplete, then leave the checksum at 0xffff.
*/
#if 0
/*
@ -2485,7 +2486,8 @@ dissect_6lowpan_iphc_nhc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi
*
* If we want to display the checksums, they will have to be recomputed
* after packet reassembly. Lots of work for not much gain, since we can
* just set the UDP checksum to 0 and Wireshark doesn't care.
* just set the UDP checksum to 0xffff (anything != 0) and Wireshark
* doesn't care.
*/
if ((udp_flags & LOWPAN_NHC_UDP_CHECKSUM) && tvb_bytes_exist(tvb, offset, length)) {
vec_t cksum_vec[3];