aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-06-10 11:02:07 -0700
committerGuy Harris <guy@alum.mit.edu>2016-06-10 18:03:09 +0000
commit8626cefd114ff49c6e3a763b72ba26b5bec06a1e (patch)
tree2411203c3e3bbf7acffe180a04b1220554a9db12 /wiretap
parent00d36c7888b5d3e9c02cd3302021af0d184cb9d0 (diff)
Make the IPv4 NRB code's comments match the IPv6 NRB code's comments.
The IPv6 comments gave more details. Change-Id: I4e4d865feadbabfd625cdf2b2b162b99c4f23efa Reviewed-on: https://code.wireshark.org/review/15815 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/pcapng.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c
index 761c535549..e9652dcc67 100644
--- a/wiretap/pcapng.c
+++ b/wiretap/pcapng.c
@@ -3139,10 +3139,17 @@ pcapng_write_name_resolution_block(wtap_dumper *wdh, int *err)
}
namelen = (guint16)(hostnamelen + 1);
nrb.record_len = 4 + namelen;
+ /* 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. */
+ /*
+ * This record would overflow our maximum size for Name
+ * Resolution Blocks; write out all the records we created
+ * before it, and start a new NRB.
+ */
+
+ /* First, copy the block header. */
memcpy(rec_data, &bh, sizeof(bh));
/* End of record */