forked from osmocom/wireshark
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
This commit is contained in:
parent
c8be3dcee2
commit
9a0e88b3a5
10
pcapio.c
10
pcapio.c
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue