aboutsummaryrefslogtreecommitdiff
path: root/pcap-usb-linux-common.c
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of trailing space.Guy Harris2023-07-181-1/+1
|
* Linux USB: avoid 32-bit unsigned integer wraparound.Guy Harris2023-07-181-7/+66
| | | | | | | | | | When adding values whose sum might overflow an unsigned integer, first check whether the sum *would* overflow an unsigned integer and, if so, clamp the sum at UINT_MAX. Do the same for a multiplication. This should fix #1134, as well as the issue in #1205.
* Fix spellingJosh Soref2023-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * amount * anymore * authentication * availability * bracket * captured * casted * communications * compliant * configurable * cumulate * deinitialize * descriptors * didn't * disassembler * disassociate * distributions * divvy * doing * entries * everything * explicitly * explosion * expression * extracting * failed * family * find * github * global * implementations * incorrectly * intel * interlocked * justifying * know * launched * libraries * malloced * mask * maximum * network * nonexistent * number * occurred * optimizer * overflow * overwrite lower * packet * packetfilter * packets * parse hosts * payload * phase * programmers * promiscuous * protocol * receiving * redefinition * sampling * savefile * schwartz * should * snapshot * something * specifies * straightforward * stream * subdir * support * surrogate * suse * system is * test with * than * those * unmaintained * valid * way * western * wireshark Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
* usb-linux: fix calculation of on-the-wire length.Guy Harris2022-08-141-3/+5
| | | | | | | | Ignore descriptors with a zero length; the only data that matters when recalculating the on-the-wire length are the ones with data, as the goal is to calculate the length of data that we would have gotten had neither usbmon nor libpcap truncated the data, and if there's no data to truncate....
* Linux USB: check the captured length early in the fixup process.Guy Harris2022-07-121-6/+4
| | | | | | | | | | In fixup_pcap_pkthdr(), check th capture length to make sure it has a full header before we start looking at fields in the header. The other place that calls fix_linux_usb_mmapped_length() already ensures that we have at least a full USB metadata header; this change means that both places that call it do, so we can remove the check from fix_linux_usb_mmapped_length() itself.
* Remove trailing space/tabFrancois-Xavier Le Bail2022-07-031-1/+1
| | | | [skip ci]
* Linux USB: make the capture file length fixup more conservative.Guy Harris2022-06-151-44/+66
| | | | | | | | | When retroactively fixing up capture file on-the-network lengths for memory-apped Linux USB captures, only fix up the on-the-network length if it has the value that would be expected from the old capture code. In the fixup code, make sure it's both >= the proper length, as best we can calculate it, and the captured length.
* Linux USB: fix incorrect values for the packet length.Guy Harris2022-06-031-0/+108
Correctly compute the "real" length for isochronous transfers. When reading memory-mapped Linux capture files, fix up the "real" length field, in case the file was written by a program doing a capture with the bug.