aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
AgeCommit message (Collapse)AuthorFilesLines
2018-01-20wiretap: more SPDX license convertions.Dario Lombardo23-328/+23
Change-Id: I12695d0713b1d7fe58f09b2037303fab523085e9 Reviewed-on: https://code.wireshark.org/review/25394 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-01-19Don't do pcap heuristics on a pipe.Guy Harris3-44/+82
Instead, just: assume a file with the regular pcap magic number is a regular pcap file, not an unhelpfully-modified-without-changing-the-magic-number format such as one of the (fortunately, short-lived) memory-mapped capture formats or the Nokia format; reject a file with the memory-mapped-capture-finally-changed-the- magic-number magic number, as they then changed the *new* format without changing its magic number; and don't even leave a provision for multiple formats using the "nanosecond pcap" magic number - not even when reading from a file - so we can punish bad behavior (which is what changing the format without changing the magic number is). This should get rid of the last place where, when reading a pcap file from a pipe, the first packet isn't displayed as soon as it arrives. Bug: 14345 Change-Id: I2fcb3354dc84cdd2d8ec749a0db883e56971c4b4 Reviewed-on: https://code.wireshark.org/review/25383 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-01-18Remove an unnecessary test.Guy Harris1-49/+44
out.next is initialized to point to the beginning of the buffer when a FILE_T is created, so it won't be null. Change-Id: Ib29f713ab3c524c9c7d83e8d9f3bef89fde1d5b5 Reviewed-on: https://code.wireshark.org/review/25380 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-01-18Don't insist on reading a full buffer from the input file.Guy Harris1-155/+266
Don't loop trying to read a full buffer from the input file. If you're reading from a file, on UN*X or Windows, you should get the entire read count unless you're fewer than buffer-size bytes from the end of the file, in which case you should get what remains in the file. If you're reading from a pipe, however, that could cause you to block longer than necessary waiting for a full buffer rather than just for the next chunk of data from the pipe - which might not be a bufferful, if the program writing to the file is itself writing less-than-bufferful chunks, as may be the case in, for example, a pipeline coming from a live capture and with the intent that TShark display the packets as they arrive. While we're at it, if we're trying to do a seek and the seek takes place within the buffer of uncompressed data, just adjust the position within that buffer for forward seeks as well as backward seeks; this substantially reduces the number of ws_lseek64() calls when making a sequential pass through the file in Wireshark (e.g., running a tap or filtering the display) and, as we purge the buffer after the ws_lseek64(), substantically reduces the number of ws_read() calls in that situation as well. Have a data structure for a file data buffer, and use it for both the "input" (compressed data) and "output" (uncompressed data) buffers. Rename raw_read() to buf_read(), as it reads into a buffer. Change-Id: I7982b3499a7613a993913a6db887054730764160 Ping-Bug: 14345 Reviewed-on: https://code.wireshark.org/review/25358 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-01-16Wiretap: Add a missing comma.Gerald Combs1-1/+1
Found via CID 1427615. Change-Id: I519b3905d33b0b2aa3ce164810b9e6358f6df1bd Reviewed-on: https://code.wireshark.org/review/25347 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-15Test explicitly against 0 for integers and NULL for pointers, but not booleans.Guy Harris1-20/+20
That makes it clearer what's being tested, and makes the tests more consistent, so we're always, not just sometimes, testing that way. Change-Id: Ifac4a86d16d0652d04db3dec572c11e1335c945d Reviewed-on: https://code.wireshark.org/review/25318 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-01-14Add a URL for RFC 1952.Guy Harris1-1/+5
Change-Id: I951829e173ef7a37ea1de7576ff919470e746974 Reviewed-on: https://code.wireshark.org/review/25317 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-01-14Check for gzipped files even if we don't have libz.Guy Harris3-3/+13
If we aren't built with libz, report a new "decompression not supported" error if the file is gzipped; the problem isn't that it's a new capture file format we don't support, it's that a *compressed* capture file, in some format, but we don't support the *compression* format used. This can be extended if we add support for other compression formats. Change-Id: I19239525d4e02357e3ca7189996556839af8fce2 Reviewed-on: https://code.wireshark.org/review/25315 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-01-11Use an enum for plugin types.Gerald Combs1-14/+2
Make plugins.c the source of truth for plugin names. Where plugins reside and what they do are two different things, so split the plugin directory and description into two separate elements. CMake creates portable[1] builds on Windows and macOS. That is, the build-time directory layout is the same as the installation directory layout. Adjust various plugin paths macOS accordingly. [1] You have to run osx-app.sh on macOS to prepare the application bundle, but the goal is to create a directory/bundle that can be moved or copied to a different system and run in the new location. Change-Id: Icf9d02e61918fdf1404468baf52542910edf2743 Reviewed-on: https://code.wireshark.org/review/25166 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-01-10IxVeriWave: Adjust signature timestamp checking.Gerald Combs1-10/+13
Move the signature timestamp bounds checks inside get_signature_ts. Fix what appears to be an off-by-one error. Bug: 14297 Change-Id: I9ca1762a8418e47153f270a1a62b2d0d3a800130 Reviewed-on: https://code.wireshark.org/review/25229 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-09wiretap: add a parameter to wtap_init() indicating whether plugins must be ↵Pascal Quantin2-6/+12
loaded g995812c5f1 moved wiretap plugins registration from applications to wiretap library init function. As we do not want to load plugins for all users of libwiretap, let's make it configurable. Bug: 14314 Change-Id: Id8fdcc484e2d0d31d3ab0bd357d3a6678570f700 Reviewed-on: https://code.wireshark.org/review/25194 Reviewed-by: Dario Lombardo <lomato@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-09Use pcapng as the name of the file format.Guy Harris12-57/+57
At one point, I remember a discussion resulting in the official name of the next-generation replacement for pcap format being changed to "pcapng", with no hyphen. Make Wireshark reflect that. Change-Id: Ie66fb13a0fe3a8682143106dab601952e9154e2a Reviewed-on: https://code.wireshark.org/review/25214 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-01-05erf: remove redundant check (CID: 1159076).Dario Lombardo1-16/+21
This check has been alreay done in line 433: since then packet_size is only decreased, then the check is redudant. Change-Id: I8ede5c733867ccc98ab2d470181d1e4a29ae5b49 Reviewed-on: https://code.wireshark.org/review/25023 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-12-29Do the right check for "no name resolution information to save".Guy Harris3-1/+11
The check that the pcapng code does is "do we have a non-null addrinfo_lists_t * and, if so, does it have a non-null ipv4_addr_list or ipv6_addr_list"? The check that the file-save code was using was just "do we have a non-null addrinfo_lists_t *", so sometimes it'd think we couldn't do a "quick save" even though we had no name resolution information to write out to the capture file. Make a routine that does that check, and use it in *both* places. Change-Id: Id4720f4fe4940354320b2b7621ca5e37e45ec1f3 Reviewed-on: https://code.wireshark.org/review/25055 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-28No need for read_new_line to return a packet offset.Guy Harris1-16/+9
We can just call file_tell() before reading the line when doing sequential reads. Change-Id: Ide36d0b7d99ef3e76dbe1ddfad6c99972c04739a Reviewed-on: https://code.wireshark.org/review/25027 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-27Add lzip to the "other compressed formats" comment.Guy Harris1-0/+2
Change-Id: Ic54840f5ed52387f1fac2296cb251ba521d3a392 Reviewed-on: https://code.wireshark.org/review/25008 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-26Fix some comments.Guy Harris1-3/+5
Change-Id: I8f22a38a944573e43f6232e0fab6188967deefd6 Reviewed-on: https://code.wireshark.org/review/24999 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-26wiretap: remove unneeded check (CID: 1396988).Dario Lombardo1-1/+1
Existence of in_file has been checked in line 908. Change-Id: Ida6c06362a1f88caec40701be7f3e42133ce404a Reviewed-on: https://code.wireshark.org/review/24994 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-21Add IEEE 802.3br Frame Preemption Protocol dissectorAnton Glukhov2-0/+4
Bug: 14280 Change-Id: I25444b069af4bb78db6ae5ff649596599eba2a0c Signed-off-by: Anton Glukhov <anton.a.glukhov@gmail.com> Reviewed-on: https://code.wireshark.org/review/24881 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-14Refactor plugin registration and loadingJoão Valverde2-60/+29
Put different types of plugins (libwiretap, libwireshark) in different subdirectories, give libwiretap and libwireshark init routines that load the plugins, and have them scan the appropriate subdirectories so that we don't even *try* to, for example, load libwireshark plugins in programs that only use libwiretap. Compiled plugins are stored in subfolders of the plugin folders, with the subfolder name being the Wireshark minor version number (X.Y). There is another hierarchical level for each Wireshark library (libwireshark, libwscodecs and libwiretap). The folder names are respectively plugins/X.Y/{epan,codecs,wiretap}. Currently we only distribute "epan" (libwireshark) plugins. Change-Id: I3438787a6f45820d64ba4ca91cbe3c8864708acb Reviewed-on: https://code.wireshark.org/review/23983 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2017-12-01dumpcap: enable capture of pcapng from pipeJames Ko1-0/+6
Reads pcapng blocks from a pipe. Section header blocks are parsed for endianess. All other blocks only have the general block header parsed for type and length, and then endianess converted if necessary. Outputs all blocks using the original endianess format so none of the other block types or options require parsing. Change-Id: I2f4f0175013d8fc2cda42a63e7deacad537951e3 Bug: 11370 Reviewed-on: https://code.wireshark.org/review/24536 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-19Fix (and chop) static build optionJoão Valverde1-12/+10
This sets the scope of the static build option to Wireshark support libraries only. Before the patch: Static plugins don't work with CMake and autotools. autotools static build is broken, and most likely will always be, as building Wireshark all-static is difficult and time-consuming. After the patch: For CMake Wireshark will be built with static or shared libraries and dynamic plugins. Everything just works. CMake apparently doesn't want you building static and shared libraries at the same time. For autotools Wireshark will be built with shared libraries by default. --disable-shared and --enable-static options work as usual. Dlopened plugins are not built if --disable-shared is given to configure (to disable shared libraries). This is a limitations imposed by libtool. Tested on Linux. This removes broken support for building plugins statically. Change-Id: Ib8e8176976f136eea93a2ce8f9857b6cf9bec64c Reviewed-on: https://code.wireshark.org/review/24241 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2017-11-18autotools: Library build products don't need explicit cleaningJoão Valverde1-7/+0
Change-Id: I5d68c05f2844d6c9ae486531b189dbf10bc09cff Reviewed-on: https://code.wireshark.org/review/24484 Reviewed-by: João Valverde <j@v6e.pt>
2017-11-15Handle LINKTYPE_JUNIPER_ST 200.Anders2-0/+3
Bug: 14195 Change-Id: Ic6be8e1f8169968c48376984c0d1a1a69c67f32a Reviewed-on: https://code.wireshark.org/review/24415 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-29"Hardcode" the port types used by Export PDU functionalityMichael Mann1-31/+34
The "internal" port type has been serialized by export PDU functionality and nettrace_3gpp_32_423 wiretap. To better support "endpoint" functionality the port types will be removed/updated and that changes the implicit values from the port_type enum. Take a snapshot of the current port_type values and use those specific values when reading/writing export PDU data and provide conversion functions that can be modified when port_types are removed. Do the same for nettrace_3gpp_32_423 wiretap. Change-Id: I770bd0cab22e84f3cf49032fc86c5927bf85263f Reviewed-on: https://code.wireshark.org/review/24169 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-29wtap.h: Replace literal buffer size with WS_INET_ADDRSTRLENJoão Valverde1-2/+3
Bug: 14149 Change-Id: Ib7d60f93373eb23f5c950607f4cf6fc832c79670 Reviewed-on: https://code.wireshark.org/review/24154 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-10-27YACC is set to the missing script if not foundJoão Valverde1-4/+0
Change-Id: I38ce7542e96c7571fa179e550cfba39d16dc417f Reviewed-on: https://code.wireshark.org/review/24117 Reviewed-by: João Valverde <j@v6e.pt>
2017-10-27autotools: Fix LN_S usageJoão Valverde1-1/+1
"cp" always takes two arguments. Change-Id: I6183988a24a38b1091d31a4e533b329f89f35dac Reviewed-on: https://code.wireshark.org/review/24113 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2017-10-26Add a ws_in6_addr typedef for struct e_in6_addr.Guy Harris3-8/+8
That allows a parallel typedef of ws_in4_addr for guint32. Change-Id: I03b230247065e0e3840eb87635315a8e523ef562 Reviewed-on: https://code.wireshark.org/review/24073 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-10-26CMake: Don't check for windows.h or winsock2.h.Gerald Combs1-1/+1
If we're building on Windows we're going to have windows.h and winsock2.h. Don't bother checking for them. Change-Id: I0004c44d7364ab3f41682f34b8c84cd8617c9603 Reviewed-on: https://code.wireshark.org/review/24068 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-18autotools: Remove abi-compliance-checker codeJoão Valverde1-24/+0
It's been broken for over a year, needs to be modernized and as implemented it's a maintenance nightmare. Get rid of it. Ping-Bug: 13036 Change-Id: I34a6e4c28b6d3b96dd6550dd21e9cbeaf050d58f Reviewed-on: https://code.wireshark.org/review/23967 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2017-10-15autotools: make maintainer-clean should allow rerunning 'configure'João Valverde1-2/+1
Change-Id: Iedae94ffefe27b13b1967d69cacb757b5aa4576d Reviewed-on: https://code.wireshark.org/review/23928 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-10-15Remove superfluous null-checks before strdup/freeAhmad Fatoum6-19/+9
NULL checks were removed for following free functions: - g_free "If mem is NULL it simply returns" https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-free - g_slist_free(_full)? "NULL is considered to be the empty list" https://developer.gnome.org/glib/stable/glib-Singly-Linked-Lists.html - g_strfreev "If str_array is NULL, this function simply returns." https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strfreev - g_slice_free "If mem is NULL, this macro does nothing." https://developer.gnome.org/glib/stable/glib-Memory-Slices.html#g-slice-free - g_match_info_free "not NULL... otherwise does nothing" https://developer.gnome.org/glib/stable/glib-Perl-compatible-regular-expressions.html#g-match-info-free - dfilter_free defined in Wireshark code. Returns early when passed NULL epan/dfilter/dfilter.c They were also removed around calls to g_strdup where applicable: - g_strdup "If str is NULL it returns NULL." https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strdup Change-Id: Ie80c2db89bef531edc3aed7b7c9f654e1d654d04 Reviewed-on: https://code.wireshark.org/review/23406 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-10-13CMake: Allow user build flags to override default build flagsJoão Valverde1-1/+0
Autotools has the very useful feature by design of allowing the user to override the default build flags (you break it you keep it). Apparently CMake applies COMPILE_OPTIONS target property after CMAKE_{C,CXX}_FLAGS so that doesn't work here. Prepend our flags to those variables instead to make it work then. Specific target flag overrides can still be added with COMPILER_OPTIONS (e.g: generated files with -Wno-warning) but this is less effective and then we're back at the point where this overrides user flags. It's less of a concern though. Change-Id: I44761a79be4289238e02d4e781fef0099628817b Reviewed-on: https://code.wireshark.org/review/23675 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-09-26Rename "ws_version_info.h", also .cJoão Valverde3-6/+6
It's not installed so like most other files it doesn't need or benefit from the prefix. Change-Id: I01517e06f12b3101fee21b68cba3bc6842bbef5c Reviewed-on: https://code.wireshark.org/review/23751 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-09-26Move some DIAG_OFFs to make code less uglyJoão Valverde1-3/+8
Change-Id: I0f343ab69a6592a466e12e5d258f0878b9c32c25 Reviewed-on: https://code.wireshark.org/review/23752 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-09-26plugins: Use g_slist_prepend() instead.João Valverde1-1/+1
Change-Id: If145137bfd44025ccab762b67960072777efd302 Reviewed-on: https://code.wireshark.org/review/23750 Reviewed-by: João Valverde <j@v6e.pt>
2017-09-25Docbook: Automatically generate the tools help output.Gerald Combs1-1/+1
Add a CMake target that dumps the help output for our command line tools to individual files. Include those files in the tools appendix instead of pasting them in manually. Fixup the output of some tools so that they pass the pre-commit checks. Change-Id: I925f24818422a190927a96531c21f4d16d3fe5b5 Reviewed-on: https://code.wireshark.org/review/23737 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-09-24autotools: Use package flags to configure libpcapJoão Valverde1-1/+2
Change-Id: Icd64014b597a8e60d2aff9d180c441c6ffccff26 Reviewed-on: https://code.wireshark.org/review/23329 Reviewed-by: João Valverde <j@v6e.pt>
2017-09-24Install libwiretap and libwscodecs headersJoão Valverde2-6/+27
Change-Id: Ie7376ac5fd8a950e3c1c744ce4701b14ee1849ea Reviewed-on: https://code.wireshark.org/review/23664 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-09-24Don't look at the comment or process table with pre-2.2 files.Guy Harris1-6/+17
NetMon apparently didn't zero out the file header, so those fields have random values in pre-2.2. Change-Id: I3aeede6ab273d57ca937a5e18e67223fb4ed18da Reviewed-on: https://code.wireshark.org/review/23666 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-19IXIA lcap supportJoerg Mayer2-0/+20
IXIA^WKeysight Technologies's vitual IxNetwork version 8.30 will create capture files in a modified format: It uses a different magic and adds the total size of all records, i.e. the filesize minus the headersize. Add support for this. v2: Different file types use different magic numbers. Not yet tested/supported: The default fileending is .lcap Bug: 14073 Change-Id: Ida90b188ca66a78ff22dca237e4fd6b22e02dc14 Reviewed-on: https://code.wireshark.org/review/23614 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-19Disable flex-generated [-Wsign-compare] warningsJoão Valverde2-0/+6
Change-Id: Iace0462e6bb50573f3e4603f7a19e4b7ee1f9733 Reviewed-on: https://code.wireshark.org/review/23541 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-09-16Inquire what frame_size < msdu_length means.Guy Harris1-1/+6
Change-Id: Ie618ed61fb098bfe55529e31e9cc3f6bfe7d4ac0 Reviewed-on: https://code.wireshark.org/review/23575 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-14Move a test.Guy Harris1-22/+25
If we're not going to subtract 4 from actual_octets, there's no reason to treat actual_octets < 4 as an error. This makes the "subtract 4 octets of crap" code similar in all cases, hopefully further reducing the opacity of the code. Change-Id: I41cda101b321422ce5fd4474fb6903bfe471cb63 Reviewed-on: https://code.wireshark.org/review/23534 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-14Replace a magic constant with an expression that represents what it is.Guy Harris1-1/+1
(In the hope of making the code slightly less opaque.) Change-Id: Ic635eedac4eb9fb764b3633c9003608b9b4ae3df Reviewed-on: https://code.wireshark.org/review/23533 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-14Fix comments.Guy Harris1-8/+14
Change-Id: Ie9fe895a2763e74a5f1e25f3f1b9d63e02c0bd71 Reviewed-on: https://code.wireshark.org/review/23532 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-14Remove the 4 octets of junk even if that leaves no octets.Guy Harris1-3/+3
Be consistent in the treatment of those 4 octets. Change-Id: If35c94bd299c3e7ec76306daf325d5aa5e3a19b9 Reviewed-on: https://code.wireshark.org/review/23530 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-12A number of 0 for actual_octets may just be an end of record instead of an ↵Joerg Mayer1-33/+42
error. Also fix some whitespace "errors". Change-Id: Ic1dc1bad6dafbbc21a87665675e654cd322178a0 Bug: 14051 Reviewed-on: https://code.wireshark.org/review/23476 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2017-09-07More [-Wmaybe-uninitialized] fixes with -OgJoão Valverde1-0/+3
There may be some amount of bogosity involved but initialize the variables and add a default case to prevent the noise and the build from breaking with -Werror. Change-Id: I20432ea74a1e5edc28be75a97077c9aa7bc87a35 Reviewed-on: https://code.wireshark.org/review/23426 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>