diff options
author | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2015-06-21 12:44:24 +0100 |
---|---|---|
committer | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2015-06-21 11:47:24 +0000 |
commit | 649c48482efd41547ad6d6ee8264e05ddceec490 (patch) | |
tree | 2ded1aa35f3636cc11976acb009740011c26d96b /editcap.c | |
parent | 334087b9e40a3e3e469c05cd725cb06bac6890b7 (diff) | |
download | wireshark-649c48482efd41547ad6d6ee8264e05ddceec490.tar.gz |
editcap: trivial changes while looking into the -L option
Change-Id: I94dd83af160eebb9dc44c123b2b83674bc5866f6
Reviewed-on: https://code.wireshark.org/review/9000
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Diffstat (limited to 'editcap.c')
-rw-r--r-- | editcap.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -728,7 +728,7 @@ print_usage(FILE *output) fprintf(output, " this option more than once, allowing up to 2 chopping\n"); fprintf(output, " regions within a packet provided that at least 1\n"); fprintf(output, " choplen is positive and at least 1 is negative.\n"); - fprintf(output, " -L adjust the frame length when chopping and/or snapping\n"); + fprintf(output, " -L adjust the frame (i.e. reported) length when chopping and/or snapping\n"); fprintf(output, " -t <time adjustment> adjust the timestamp of each packet;\n"); fprintf(output, " <time adjustment> is in relative seconds (e.g. -0.5).\n"); fprintf(output, " -S <strict adjustment> adjust timestamp of packets if necessary to insure\n"); @@ -1395,12 +1395,16 @@ DIAG_ON(cast-qual) phdr = wtap_phdr(wth); if (snaplen != 0) { + /* Limit capture length to snaplen */ if (phdr->caplen > snaplen) { + /* Copy and change rather than modify returned phdr */ snap_phdr = *phdr; snap_phdr.caplen = snaplen; phdr = &snap_phdr; } + /* If -L, also set reported length to snaplen */ if (adjlen && phdr->len > snaplen) { + /* Copy and change rather than modify returned phdr */ snap_phdr = *phdr; snap_phdr.len = snaplen; phdr = &snap_phdr; |