Commit Graph

84362 Commits

Author SHA1 Message Date
Guy Harris 6014d7ad2b cpuid: clean up, update. and expand some comments. 2022-06-01 00:42:47 -07:00
Guy Harris 02eb128bef cpuid: don't use __cpuid on non-x86 Windows.
We aren't *yet* building ARM64 Wireshark for Windows, but throw in a bit
of future-proofing.  (I guess nobody ever built it for Itanium.)
2022-06-01 00:07:59 -07:00
John Thacker 356a6ab0ea file: Free fname_new when rename successful.
Plug a memory leak.
2022-06-01 02:17:47 +00:00
John Thacker 0d2e248a25 file: Only change the file descriptors on a Save with Copy
If we do a save with copy, so that we just copied the binary
file, everything in the wtap structure should be the same except
for the filename and the file descriptors, so just change that
instead of closing wtap and reopening it.

The current behavior of calling wtap_open_offline does not work
for files that have blocks (SHBs, IDBs, NRBs, DSBs, ISBs, etc.) in
the middle of the file instead of at the beginning, but we shouldn't
have to waste time rescanning the entire file either.

In the case where a specific file format reader was manually selected,
this will keep the same file format as selected instead of switching to
the auto-detection when opening the copy, just as SAVE_WITH_MOVE already
does and presumably what the user wants.

Update wtap_fdreopen to change the wtap struct's pathname if
wtap_fdreopen is called with a different filename than currently.

Fix #17472
2022-06-01 02:03:57 +00:00
Gerald Combs 429c7a6ce3 epan: Don't free epan-scoped memory.
e6a8318f18 allocated our element list map key in epan scope. Don't try
to free it.
2022-05-31 10:31:22 -07:00
Dirk Ziegelmeier 66b73ddd11 Profinet plugin: Dissect writing I&M1 and I&M2, too 2022-05-31 15:29:24 +00:00
Dirk Ziegelmeier 1438336c1d Profinet plugin: Decode more error codes
according to PN Protocol 2.4MU3 April 2022
2022-05-31 15:29:24 +00:00
Dario Lombardo b49edf0a5b
github: update macos action. 2022-05-31 10:20:25 +02:00
Gerald Combs e8dc20899f epan: Remove conversation_create_endpoint options.
The "options" paramameter was never used, so remove it.
2022-05-29 18:00:09 -07:00
Gerald Combs 48ff21b573 [Automatic update for 2022-05-29]
Update manuf, services enterprise numbers, translations, and other items.
2022-05-29 17:20:25 +00:00
John Thacker 6fd1c08a3a TCP: Don't add [TCP segment of a reassembled PDU] to the second PDU
When desegmenting, don't add [TCP segment of a reassembled PDU] to
the INFO column if we've already dissected a complete PDU in this
frame. This is for the same reasons that we set a fence in the INFO
column and set the PROTOCOL column to be not writable. It's not
of particular interest that this frame also contains the start of
a new PDU when the INFO column has information about a complete
higher level PDU. The information about the other PDU is contained
in the tcp tree elements.

Fix #15494
2022-05-29 11:42:17 -04:00
John Thacker ec12d0c530 TCP: Report reassembled in for more PDUs where we know it
In the case where the beginning of a TCP segment does not continue
a higher-level PDU, but the end of the segment is the beginning of
another PDU, we don't need to create the MSP for the second PDU
after the first time we visit the packet. However, we do want to
retrieve that MSP for determining in which frame the second PDU
was reassembled.

Make "Reassembled PDU in frame:" messages be added in that case
like it already is for other frames with MSPs.
2022-05-29 10:59:55 -04:00
John Thacker 717e4c47ee TCP: reset addresses and ports after each segment
TCP can contain multiple PDUs of the next layer protocol, and the
subdissector (or further subdissectors called from it) can change
the addresses and ports. However, the addresses and ports are used
for the desegmentation tables at the TCP level, as well as for
various purposes in encapsulated protocols.

Restore the addresses and ports values of packet_info before each PDU,
and in desegment_tcp after returning from a subdissector. When leaving
desegment_tcp ensure that the addresses and ports are set to whatever
they were after the last subdissector call that successfully
desegmented a PDU.

Fix #2345. Fix #9782.
2022-05-28 20:41:52 -04:00
John Thacker 95ba1151df TCP: Handle additional data requested with ooo reassembly
The test for "old_len" with a reassembled MSP has never been accurate
for out of order reassembly, where it caused additional data requested
to be taken from the end of the current frame instead of from the
correct portion of the reassembled MSP, which could be from an
out of order frame (later in sequence, but arrived earlier.)

The test is unnecessary - the other case, where we need more data
but there's more in the current frame is already handled by looping again.

This fixes reassembly where TCP is out of order and those out of order
segments don't align on PDU boundaries. Fix #13317.

Also fix a minor issue in the same situation where the length of the
current segment was indicated incorrectly for out of order frames
contributing to multiple MSPs.
2022-05-28 21:40:19 +00:00
Martin Mathieson 17322b0cc2 Make a couple of functions static. 2022-05-28 20:35:58 +01:00
Dana Sy cba61d08f8 Zigbee: Touchlink typo
Fixed typo for Touchlink command filter name
2022-05-28 09:09:43 +00:00
Dana Sy 7df725a119 Zigbee: Touchlink missing info field
Added in the profile interop bit for the Touhlink information field.
2022-05-28 09:09:43 +00:00
Dario Lombardo 941539b6a2 debian: add missing symbol. 2022-05-27 23:04:50 +00:00
Uli Heilmeier 083c6828f5 EOBI: Disable dissector by default
The EOBI dissector has no heuristic and is using several nonstandardized
high ports. Therefore disabling it by default.

Fixes #18103
2022-05-27 19:04:59 +00:00
Uli Heilmeier 9fa0d711f6 O-RAN: Fix offset extension 10 and beam vector list
Increment offset and use numPortc for number of beam vector list items

Fixes: #18116
2022-05-27 18:47:49 +00:00
João Valverde cd73921a9e lrexlib: Disable a warning [-Wshorten-64-to-32]
The warning is harmless and we want to keep upstream code
as pristine as possible (unless there is a real issue in
the code of course) so disable the warning.
2022-05-27 15:14:16 +01:00
Gerald Combs 370c58f913 macOS: Add Logwolf packaging targets.
Rename the following build targets:

app_bundle to wireshark_app_bundle
dmg_package_prep to wireshark_dmg_prep
dmg_package to wireshark_dmg

Add logwolf_app_bundle, logwolf_dmg_prep, and logwolf_dmg targets and
packaging assets. Update the documentation.

We need to add a set of Logwolf version variables to CMake and
make-version.pl. Add a static logwolf-version attribute to
attributes.adoc in the mean time.
2022-05-26 20:29:20 +00:00
Gerald Combs 5373483963 Tools: Add a CMakeExecutable parameter to win-setup.ps1.
52054046c1 switched archive extraction from 7Zip to CMake. This removed
a dependency on 7Zip, but assumed that CMake was in our PATH.  Add a
CMakeExecutable to win-setup.ps1 and use it in CMakeLists.txt to pass
the value of CMAKE_COMMAND.
2022-05-26 20:13:18 +00:00
Gerald Combs e6a8318f18 epan: Fix our conversation key lifetimes.
wmem_map doesn't copy keys, so we need to keep them around.
2022-05-26 11:28:21 -07:00
João Valverde b8279a6ce1 lrexlib: Pacify checkAPIs 2022-05-26 10:09:13 +00:00
João Valverde 8ff24c2b6e Lua: Add lrexlib-pcre2 Lua regex bindings
Add the de facto standard Lua regex API to Wireshark. Upstream
code is copied verbatim and the module opened in the "rex" table.
This is just a user convenience and developer quality of life improvement
over the GRegex Lua API because it has always been possible to
load lrexlib-pcre2 as a Lua module from Wireshark.
2022-05-26 10:09:13 +00:00
João Valverde e6da2cd8de Lua: Remove on-life-support GRegex bindings
This code has been unmaintained and does not pass the lrexlib test
suite. GRegex itself has been obsolescent for some time, although GNOME
has recently restarted trying to move it to PCRE2.

Remove it in preparation for a move to lrexlib-pcre2.
2022-05-26 10:09:13 +00:00
John Thacker 7ab343e7d6 tcp: Split MSPs in out of order processing
When processing segments out of order in TCP, it is possible to
get new segments that fill a sequence gap and be able to dissect
at least one PDU but need more data for additional PDUs (that have
data from the contiguous stream bytes.) We can only determine this
after passing the reassembled segments to the subdissector first.

To keep dissection and layer numbers consistent between passes,
split the multisegment PDU, keeping the already dissect PDU(s) in
the current reassembly and creating a new MSP for the parts not yet
dissected.

Update the dissection test to enable the currently skipped test that
require MSP splitting and remove test_tcp_out_of_order_twopass_with_bug
2022-05-26 00:49:16 +00:00
João Valverde ab33d9b809 Qt6+MSYS2: Fix windeployqt usage
The msys2 qt6 package installs windeployqt as windeployqt-qt6.
2022-05-25 23:46:23 +01:00
João Valverde ee7094d34c CMake: Fix typo 2022-05-25 23:46:01 +01:00
João Valverde 9c86d22e5b MSYS2: Fix compilation error 2022-05-25 23:45:32 +01:00
Gerald Combs 34d74031a9 epan+Qt: Add element tables to the ConversationHashTablesDialog.
Add get_conversation_hashtables() and use it to populate the
conversation hash tables dialog.
2022-05-25 19:09:12 +00:00
Alexis La Goutte 966969e777 conversation(.h): Fix -Wdocumentation 2022-05-25 18:53:48 +00:00
Tomasz Moń 1a60de0b76
USB: Sanitize USB 2.0 endpoint max packet size
Introduce Wireshark specific enum to facilitate USB speed specific
dissection. Any similarity of actual enum values with any protocol
is coincidence and should not be relied upon.

Rename speed defines in USBIP dissector to not collide with Wireshark
USB speed enum. The values used in USBIP are implementation specific.

Allow user to set capture speed in USBLL dissector preferences. Use the
selected speed in USB dissector to sanitize endpoint maximum packet size
value based on speed specfic requirements from USB 2.0 specification.

Close #18062
2022-05-25 20:26:24 +02:00
Gerald Combs aef4c0c60a epan: Allocate a conversation key.
Blind attempt at fixing #18113.
2022-05-25 10:38:36 -07:00
Gerald Combs 19e1764ca5 epan: Lazily create conversation dissector trees.
Create our dissector tree maps only when we need them.
Fixes #18109.
2022-05-25 09:40:55 -07:00
Joakim Karlsson 7a59f8a22c gprscdr: Update to 3GPP TS 32.298 V17.2.0
Only documentation changes, no new c file is generated
2022-05-25 13:56:21 +02:00
Martin Mathieson 0188c9a1da ORAN FH-CUS: Section type 5 has ef field. 2022-05-25 07:19:53 +00:00
John Thacker 485aedf4e1 tap-iostat: Make a bunch of ints unsigned
Almost all the ints in tap-iostat are loop counters, numbers of columns
or rows, durations, lengths, widths, or magnitudes, all things that are
inherently unsigned. Make them unsigned.

This has the incidental effect of fixing an odd alloc-size-larger-than
error with gcc 12.1, which is afraid that if borderlen is signed that
g_malloc will somehow be called with value -1 (18446744071562067969):

Fix #18089
2022-05-24 20:27:04 -04:00
Gerald Combs c0032f2f0d epan: Switch the conversation IDs back to guint32s.
Switch the _by_id IDs back to guint32s. None of the current callers need
64 bits and if someone needs 64-bit IDs they can use conversation_new_full.
2022-05-24 12:07:48 -07:00
Gerald Combs 286aec2436 Tools: Clean up win-setup.ps1's CleanupItems
Remove some items from CleanupItems that are no longer relevant.
2022-05-24 18:15:00 +00:00
Gerald Combs f065fdbc63 Windows: Upgrade zstd to 1.5.2. 2022-05-24 17:51:31 +00:00
Gerald Combs 865feb2bf8 epan: Switch some _by_id conversation routines to elements.
Switch the non-endpoint *_by_id conversation routines to use element
lists. Change the ID type from guint32 to guint64. None of them used the
address+port option flag arguments, so remove them.
2022-05-24 17:18:21 +00:00
Gerald Combs e5fc7c1d83 Tools: Switch to a new Windows development library repository.
Download our third party libraries and drivers from dev-libs.wireshark.org
in win-setup.ps1. Automatically check our state based on our library
filenames and hashes instead of a manually updated tag.
2022-05-24 16:53:49 +00:00
Martin Mathieson f3db612fa1 PDCP-NR: Fix a test (flagged by coverity) 2022-05-24 16:59:29 +01:00
Anders Broman 8be21c7867 SIP: Add a filter for VIA parameter be-route 2022-05-24 14:41:42 +00:00
Anders Broman e6c4557c0b SIP: Handle short frame in dissect_sip_sec_mechanism() 2022-05-24 13:10:01 +02:00
Martin Mathieson 20b311e7a9 PDCP-NR: Add separate UL/DL expert info ei items for missing SNs 2022-05-24 08:07:10 +00:00
João Valverde 66506483bf Minor release notes clean up
Add a new item about field references and reorganize the
list roughly by relevance.
2022-05-24 01:35:23 +01:00
João Valverde 94fe2b195c Try to fix some warnings.
[1638/2312] Building C object epan/ftypes/CMakeFiles/ftypes.dir/ftype-protocol.c.o
FAILED: epan/ftypes/CMakeFiles/ftypes.dir/ftype-protocol.c.o
/usr/bin/ccache /usr/bin/cc -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DWS_BUILD_DLL -I. -I../ -I../include -Iepan/ftypes -I../epan/ftypes -I../epan -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -fvisibility=hidden  -fexcess-precision=fast -Wall -Wextra -Wendif-labels -Wpointer-arith -Wformat-security -fwrapv -fno-strict-overflow -Wvla -Waddress -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings -Wno-long-long -Wredundant-decls -Wno-error=maybe-uninitialized -Wno-format-truncation -Wframe-larger-than=32768 -fdiagnostics-color=always -Wunused-const-variable -Wshadow -Wold-style-definition -Wstrict-prototypes -Wlogical-op -Wjump-misses-init -Werror=implicit -Wno-pointer-sign  -fmacro-prefix-map=/builds/wireshark/wireshark/= -fmacro-prefix-map=/builds/wireshark/wireshark/build/= -fmacro-prefix-map=../= -O2 -g -DNDEBUG -fPIC   -std=gnu11 -Werror -MD -MT epan/ftypes/CMakeFiles/ftypes.dir/ftype-protocol.c.o -MF epan/ftypes/CMakeFiles/ftypes.dir/ftype-protocol.c.o.d -o epan/ftypes/CMakeFiles/ftypes.dir/ftype-protocol.c.o   -c ../epan/ftypes/ftype-protocol.c
../epan/ftypes/ftype-protocol.c: In function ‘_tvbcmp’:
../epan/ftypes/ftype-protocol.c:248:62: error: operand of ?: changes signedness from ‘int’ to ‘guint’ {aka ‘unsigned int’} due to unsignedness of other operand [-Werror=sign-compare]
  248 |  guint a_len = a->length < 0 ? tvb_captured_length(a->tvb) : a->length;
      |                                                              ^~~~~~~~~
../epan/ftypes/ftype-protocol.c:249:62: error: operand of ?: changes signedness from ‘int’ to ‘guint’ {aka ‘unsigned int’} due to unsignedness of other operand [-Werror=sign-compare]
  249 |  guint b_len = b->length < 0 ? tvb_captured_length(b->tvb) : b->length;
      |                                                              ^~~~~~~~~
../epan/ftypes/ftype-protocol.c: In function ‘slice’:
../epan/ftypes/ftype-protocol.c:224:60: error: argument ‘length’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
  224 | slice(fvalue_t *fv, GByteArray *bytes, guint offset, guint length)
      |                                                      ~~~~~~^~~~~~
cc1: all warnings being treated as errors
2022-05-23 23:04:07 +01:00