diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-09-29 22:54:13 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-09-29 22:54:13 +0000 |
commit | 9a0e88b3a5960cc12e30f0239cd751fb0991e663 (patch) | |
tree | df0cccc060c3d7dc61e9ab66f5b35ad5a2b9c218 /pcapio.c | |
parent | c8be3dcee27e2fd2e0da79c64ff24605036b68bc (diff) | |
download | wireshark-9a0e88b3a5960cc12e30f0239cd751fb0991e663.tar.gz |
For an EPB, write out an "end of options" option if we write out any
other options.
Eliminate duplicate comment.
Fix indentation.
svn path=/trunk/; revision=52280
Diffstat (limited to 'pcapio.c')
-rw-r--r-- | pcapio.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -529,7 +529,6 @@ pcapng_write_enhanced_packet_block(FILE* pfile, sizeof(guint32)); } /* If we have options add size of end-of-options */ - /* If we have options add size of end-of-options */ if (options_length != 0) { options_length += (guint32)sizeof(struct option); } @@ -564,7 +563,14 @@ pcapng_write_enhanced_packet_block(FILE* pfile, option.value_length = 0; if (!write_to_file(pfile, (const guint8*)&option, sizeof(struct option), bytes_written, err)) return FALSE; - } + } + if (options_length != 0) { + /* write end of options */ + option.type = OPT_ENDOFOPT; + option.value_length = 0; + if (!write_to_file(pfile, (const guint8*)&option, sizeof(struct option), bytes_written, err)) + return FALSE; + } return write_to_file(pfile, (const guint8*)&block_total_length, sizeof(guint32), bytes_written, err); } |