use the correct record length for an IPv6 record in the NRB
authormartink <martink@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 28 Dec 2013 20:37:21 +0000 (20:37 +0000)
committermartink <martink@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 28 Dec 2013 20:37:21 +0000 (20:37 +0000)
this is already correct in 1.8 and 1.10 and was
accidentially(?) changed in r52176

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@54479 f5534014-38df-0310-8fa8-9805f1628bb7

wiretap/pcapng.c

index 30d178f6c3d5039a2d9bd5c1eaa1f9bb71ea90d4..0824114559cab302c190ba272963a9d99d609a5d 100644 (file)
@@ -3496,8 +3496,9 @@ pcapng_write_name_resolution_block(wtap_dumper *wdh, int *err)
 
             nrb.record_type = NRES_IP6RECORD;
             namelen = (gint)strlen(ipv6_hash_list_entry->name) + 1;
-            nrb.record_len = 16 + namelen;
-            tot_rec_len = 16 + nrb.record_len + PADDING4(nrb.record_len);
+            nrb.record_len = 16 + namelen;  /* 16 bytes IPv6 address length */
+            /* 2 bytes record type, 2 bytes length field */
+            tot_rec_len = 4 + nrb.record_len + PADDING4(nrb.record_len);
 
             if (rec_off + tot_rec_len > NRES_REC_MAX_SIZE){
                 /* We know the total length now; copy the block header. */