diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..15ac5df --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/wireshark-2.6.2.tar.xz diff --git a/90-wireshark-usbmon.rules b/90-wireshark-usbmon.rules new file mode 100644 index 0000000..10a127c --- /dev/null +++ b/90-wireshark-usbmon.rules @@ -0,0 +1 @@ +SUBSYSTEM=="usbmon", GROUP="usbmon", MODE="640" diff --git a/EMPTY b/EMPTY deleted file mode 100644 index 0519ecb..0000000 --- a/EMPTY +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SIGNATURES-2.6.2.txt b/SIGNATURES-2.6.2.txt new file mode 100644 index 0000000..d7afcf1 --- /dev/null +++ b/SIGNATURES-2.6.2.txt @@ -0,0 +1,60 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA512 + +wireshark-2.6.2.tar.xz: 28392140 bytes +SHA256(wireshark-2.6.2.tar.xz)=49b2895ee3ba17ef9ef0aebfdc4d32a778e0f36ccadde184516557d5f3357094 +RIPEMD160(wireshark-2.6.2.tar.xz)=e9b782d49d9a063ba556320e9f2c08dea079967d +SHA1(wireshark-2.6.2.tar.xz)=52517c30926211b0b718815b51a3f06a18d8f5da + +Wireshark-win64-2.6.2.exe: 59963968 bytes +SHA256(Wireshark-win64-2.6.2.exe)=88aa2ca018090fc73ffb273aa1ba9f690ec06deb77d1ec7ff9b39fe646ca2877 +RIPEMD160(Wireshark-win64-2.6.2.exe)=3b947ada3e64bfb1c1b16a470926d94ed9db391b +SHA1(Wireshark-win64-2.6.2.exe)=90217eb0ed020a53a9ae80682c0881d347d11b4a + +Wireshark-win32-2.6.2.exe: 54249888 bytes +SHA256(Wireshark-win32-2.6.2.exe)=3d886e435570b7326f53d00996040ef65b9e2a5bffe48645ce29ea5a23930801 +RIPEMD160(Wireshark-win32-2.6.2.exe)=c2c5afa101559976439f36401ea1cc4564fa624e +SHA1(Wireshark-win32-2.6.2.exe)=eb7c50e80d6e7ec834599c1facfd6a3fd66aebf8 + +Wireshark-win32-2.6.2.msi: 43728896 bytes +SHA256(Wireshark-win32-2.6.2.msi)=99d5d94345a20e177736533840ff59859a76e864247a8146a73fca227f004043 +RIPEMD160(Wireshark-win32-2.6.2.msi)=7f21412e4d335f6e797356b968fbef14afb03b8c +SHA1(Wireshark-win32-2.6.2.msi)=05f1f9c4b9bed8c4447e5e31f907c578f52cf067 + +Wireshark-win64-2.6.2.msi: 49364992 bytes +SHA256(Wireshark-win64-2.6.2.msi)=381076d09c757038072f761f7eee9d5aa45fa8423b771ba34ddbd8b56f2c429c +RIPEMD160(Wireshark-win64-2.6.2.msi)=a080eec0f8bd089f493d0c76837d7fe03c1fa0dd +SHA1(Wireshark-win64-2.6.2.msi)=2c6b5bf555729d1e5ee3a1dda8d2b14d3bb01759 + +WiresharkPortable_2.6.2.paf.exe: 37482552 bytes +SHA256(WiresharkPortable_2.6.2.paf.exe)=d36727bdb8cc3a72bfb80084d3c634c3bfa4661f4de68d644b43ef5d41c52b69 +RIPEMD160(WiresharkPortable_2.6.2.paf.exe)=a98756bf5a67e47e1ca9ecd8836f2e6913a56f27 +SHA1(WiresharkPortable_2.6.2.paf.exe)=dd11e62f34212be77abee9d2227a2fd3b613b0a5 + +Wireshark 2.6.2 Intel 64.dmg: 169012317 bytes +SHA256(Wireshark 2.6.2 Intel 64.dmg)=ef54b04a73df4069e29e77bc1940f3b767ee498c4e28f739eabda78ef71ab4a9 +RIPEMD160(Wireshark 2.6.2 Intel 64.dmg)=f93d2cc4057337ca76d1aa435b0039a60927bebb +SHA1(Wireshark 2.6.2 Intel 64.dmg)=3a46de720848b286e7c115c75c7b00bcd08155aa + +You can validate these hashes using the following commands (among others): + + Windows: certutil -hashfile Wireshark-win64-x.y.z.exe SHA256 + Linux (GNU Coreutils): sha256sum wireshark-x.y.z.tar.xz + macOS: shasum -a 256 "Wireshark x.y.z Intel 64.dmg" + Other: openssl sha256 wireshark-x.y.z.tar.xz +-----BEGIN PGP SIGNATURE----- + +iQIzBAEBCgAdFiEEWlrbp9vqbD+HIk8ZgiRKeOb+ruoFAltPqKQACgkQgiRKeOb+ +rurNbg//dw5903/0W2vw1a6u8F9JVvXfctb9/t1IOD2yT2omPXFTfqEkcwcY5c8W +FoSsflHM6g4rf8jqpqyipSPb6lYRJjm1fZGDzTilVPe+pcAV/HZ2QSdwOgw9FiAs +sV2eZdqPMVqdeLgDGtC4aHHabwsytFNaWtZLVyKr4ojdUfJNIBa40iUrItxXfgxA +GDCnVpdapuygk4rMeDpi3qZtvEKmgZ9Yj5aseX+wBYIT21EShP/gHSKNSA8x3gGz +xnpvOrz2qyJmWB6sBmIQndEXrYdazKr14Fzhmc2ajFMOJLwTGIZg5wl+UDnmPikW +6R1gRzSwkjEtgTKlZ9Gcel8eg6fNjW9HC9d4VjZzG4N693YrYwlpu0FIvaK+QGxE +yEJKPJnlaCi37Q6GBiKIpC5NUkTnt38Gb5DJ4/N3tk4P2LGlSyyMxLc5U096Zd8V +KCE/OVUuZs/4NsgIYaTYWDyTeNjjN2ZXnyx0N3x8yzWHcB6gYVPJc2lKouZe9XqZ +9Gz1Fr0/LEbx+r0iFOEm9pX/W8a5pzZnMn5YYUeTue61ZZp/yBOf7oTqjCVvSPHU +rZhsHMLcZnBNFoYKr03dcvukgSNsndTJPXvAEIX9FVmQUcQAEsdXRFO/csihG7l/ +7KWgNjReI7eoWkBUH8sx7J+4wZVy9leWjHTtkZKTeOo6OO1vJx4= +=OiJq +-----END PGP SIGNATURE----- diff --git a/sources b/sources new file mode 100644 index 0000000..8d81618 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (wireshark-2.6.2.tar.xz) = e39cd8dec44c8c64e5da25df0ffda529130541e5267fb0bdaa232fb4a4438c28ac5c9169ba17a37119d6cedf04a022b40da09f35f44a3739bdfb9486703f39e2 diff --git a/wireshark-0002-Customize-permission-denied-error.patch b/wireshark-0002-Customize-permission-denied-error.patch new file mode 100644 index 0000000..9b3451f --- /dev/null +++ b/wireshark-0002-Customize-permission-denied-error.patch @@ -0,0 +1,57 @@ +From: Jan Safranek +Date: Fri, 26 Nov 2010 14:30:45 +0300 +Subject: [PATCH] Customize 'permission denied' error. + +Add Fedora-specific message to error output when dumpcap cannot be started +because of permissions. + +Signed-off-by: Jan Safranek + +diff --git a/capchild/capture_sync.c b/capchild/capture_sync.c +index 2f9d2cc..b18e47f 100644 +--- a/capchild/capture_sync.c ++++ b/capchild/capture_sync.c +@@ -375,6 +375,7 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, voi + gchar *signal_pipe_name; + #else + char errmsg[1024+1]; ++ const char *securitymsg = ""; + int sync_pipe[2]; /* pipe used to send messages from child to parent */ + enum PIPES { PIPE_READ, PIPE_WRITE }; /* Constants 0 and 1 for PIPE_READ and PIPE_WRITE */ + #endif +@@ -728,8 +729,11 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, voi + dup2(sync_pipe[PIPE_WRITE], 2); + ws_close(sync_pipe[PIPE_READ]); + execv(argv[0], argv); +- g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s", +- argv[0], g_strerror(errno)); ++ if (errno == EPERM || errno == EACCES) ++ securitymsg = "\nAre you a member of the 'wireshark' group? Try running\n'usermod -a -G wireshark _your_username_' as root."; ++ g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s%s", ++ argv[0], g_strerror(errno), securitymsg); ++ + sync_pipe_errmsg_to_parent(2, errmsg, ""); + + /* Exit with "_exit()", so that we don't close the connection +@@ -826,6 +830,7 @@ sync_pipe_open_command(char** argv, int *data_read_fd, + int i; + #else + char errmsg[1024+1]; ++ const char *securitymsg = ""; + int sync_pipe[2]; /* pipe used to send messages from child to parent */ + int data_pipe[2]; /* pipe used to send data from child to parent */ + #endif +@@ -1003,8 +1008,11 @@ sync_pipe_open_command(char** argv, int *data_read_fd, + ws_close(sync_pipe[PIPE_READ]); + ws_close(sync_pipe[PIPE_WRITE]); + execv(argv[0], argv); +- g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s", +- argv[0], g_strerror(errno)); ++ execv(argv[0], (gpointer)argv); ++ if (errno == EPERM || errno == EACCES) ++ securitymsg = "\nAre you a member of the 'wireshark' group? Try running\n'usermod -a -G wireshark _your_username_' as root."; ++ g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s%s", ++ argv[0], g_strerror(errno), securitymsg); + sync_pipe_errmsg_to_parent(2, errmsg, ""); + + /* Exit with "_exit()", so that we don't close the connection diff --git a/wireshark-0003-fix-string-overrun-in-plugins-profinet.patch b/wireshark-0003-fix-string-overrun-in-plugins-profinet.patch new file mode 100644 index 0000000..8277a8c --- /dev/null +++ b/wireshark-0003-fix-string-overrun-in-plugins-profinet.patch @@ -0,0 +1,18 @@ +From: Peter Hatina +Date: Wed, 4 Sep 2013 10:03:57 +0200 +Subject: [PATCH] fix string overrun in plugins/profinet + + +diff --git a/plugins/epan/profinet/packet-dcom-cba.c b/plugins/epan/profinet/packet-dcom-cba.c +index 0f1658a..f7fd322 100644 +--- a/plugins/epan/profinet/packet-dcom-cba.c ++++ b/plugins/epan/profinet/packet-dcom-cba.c +@@ -555,7 +555,7 @@ dissect_ICBAPhysicalDevice_get_LogicalDevice_rqst(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep) + { + guint32 u32Pointer; +- gchar szStr[1000]; ++ gchar szStr[1000] = ""; + guint32 u32MaxStr = sizeof(szStr); + gchar *call; + diff --git a/wireshark-0004-Restore-Fedora-specific-groups.patch b/wireshark-0004-Restore-Fedora-specific-groups.patch new file mode 100644 index 0000000..2cdf2ea --- /dev/null +++ b/wireshark-0004-Restore-Fedora-specific-groups.patch @@ -0,0 +1,15 @@ +From: Peter Lemenkov +Date: Fri, 13 Sep 2013 14:36:55 +0400 +Subject: [PATCH] Restore Fedora-specific groups + +Signed-off-by: Peter Lemenkov +diff --git a/wireshark.desktop b/wireshark.desktop +index 334db48..669c6f1 100644 +--- a/wireshark.desktop ++++ b/wireshark.desktop +@@ -108,4 +108,4 @@ Terminal=false + MimeType=application/vnd.tcpdump.pcap;application/x-pcapng;application/x-snoop;application/x-iptrace;application/x-lanalyzer;application/x-nettl;application/x-radcom;application/x-etherpeek;application/x-visualnetworks;application/x-netinstobserver;application/x-5view;application/x-tektronix-rf5;application/x-micropross-mplog;application/x-apple-packetlogger;application/x-endace-erf;application/ipfix;application/x-ixia-vwr; + # Category entry according to: + # http://standards.freedesktop.org/menu-spec/1.0/ +-Categories=Network;Monitor;Qt; ++Categories=Application;Network;Monitor;Qt; diff --git a/wireshark-0005-Fix-paths-in-a-wireshark.desktop-file.patch b/wireshark-0005-Fix-paths-in-a-wireshark.desktop-file.patch new file mode 100644 index 0000000..a762194 --- /dev/null +++ b/wireshark-0005-Fix-paths-in-a-wireshark.desktop-file.patch @@ -0,0 +1,20 @@ +From: Kenneth Soerensen +Date: Wed, 29 Jan 2014 16:04:12 +0400 +Subject: [PATCH] Fix paths in a wireshark.desktop file + + +diff --git a/wireshark.desktop b/wireshark.desktop +index 669c6f1..f7df1f3 100644 +--- a/wireshark.desktop ++++ b/wireshark.desktop +@@ -102,8 +102,8 @@ Comment[tr]=Ağ trafiği çözümleyicisi + Comment[vi]=Trình phân tích giao thông mạng + Comment[uk]=Аналізатор мережевого трафіку + Icon=wireshark +-TryExec=wireshark +-Exec=wireshark %f ++TryExec=/usr/bin/wireshark ++Exec=/usr/bin/wireshark %f + Terminal=false + MimeType=application/vnd.tcpdump.pcap;application/x-pcapng;application/x-snoop;application/x-iptrace;application/x-lanalyzer;application/x-nettl;application/x-radcom;application/x-etherpeek;application/x-visualnetworks;application/x-netinstobserver;application/x-5view;application/x-tektronix-rf5;application/x-micropross-mplog;application/x-apple-packetlogger;application/x-endace-erf;application/ipfix;application/x-ixia-vwr; + # Category entry according to: diff --git a/wireshark-0006-Move-tmp-to-var-tmp.patch b/wireshark-0006-Move-tmp-to-var-tmp.patch new file mode 100644 index 0000000..faf34b5 --- /dev/null +++ b/wireshark-0006-Move-tmp-to-var-tmp.patch @@ -0,0 +1,330 @@ +From cb54210f7f02b07768cfbf49ae266d487f580e1b Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Thu, 29 Jun 2017 15:32:58 +0200 +Subject: [PATCH] Move /tmp to /var/tmp + +Fedora is using tmpfs which is limited by the size of RAM, thus we need +to use different directory on different filesystem. +--- + ui/gtk/about_dlg.c | 3 +- + ui/qt/about_dialog.cpp | 3 +- + ui/qt/iax2_analysis_dialog.cpp | 5 +-- + ui/qt/rtp_analysis_dialog.cpp | 5 +-- + ui/qt/rtp_audio_stream.cpp | 3 +- + wsutil/Makefile.am | 6 ++-- + wsutil/tempfile.c | 9 +++--- + wsutil/tempfile.h | 4 +-- + wsutil/wstmpdir.c | 70 ++++++++++++++++++++++++++++++++++++++++++ + wsutil/wstmpdir.h | 39 +++++++++++++++++++++++ + 10 files changed, 132 insertions(+), 15 deletions(-) + create mode 100644 wsutil/wstmpdir.c + create mode 100644 wsutil/wstmpdir.h + +diff --git a/ui/gtk/about_dlg.c b/ui/gtk/about_dlg.c +index 22ca841..6bcb527 100644 +--- a/ui/gtk/about_dlg.c ++++ b/ui/gtk/about_dlg.c +@@ -28,6 +28,7 @@ + #include + + #include ++#include /* for get_tmp_dir() */ + #include + #include + #ifdef HAVE_LIBSMI +@@ -427,7 +428,7 @@ about_folders_page_new(void) + "capture files"); + + /* temp */ +- about_folders_row(table, "Temp", g_get_tmp_dir(), ++ about_folders_row(table, "Temp", get_tmp_dir(), + "untitled capture files"); + + /* pers conf */ +diff --git a/ui/qt/about_dialog.cpp b/ui/qt/about_dialog.cpp +index 31dc581..2f74285 100644 +--- a/ui/qt/about_dialog.cpp ++++ b/ui/qt/about_dialog.cpp +@@ -26,6 +26,7 @@ + + #include "wireshark_application.h" + #include ++#include /* for get_tmp_dir() */ + + #include + #include +@@ -206,7 +206,7 @@ FolderListModel::FolderListModel(QObject * parent): + appendRow( QStringList() << tr("\"File\" dialogs") << get_last_open_dir() << tr("capture files")); + + /* temp */ +- appendRow( QStringList() << tr("Temp") << g_get_tmp_dir() << tr("untitled capture files")); ++ appendRow( QStringList() << tr("Temp") << get_tmp_dir() << tr("untitled capture files")); + + /* pers conf */ + appendRow( QStringList() << tr("Personal configuration") +diff --git a/ui/qt/iax2_analysis_dialog.cpp b/ui/qt/iax2_analysis_dialog.cpp +index ee4e5fd..fe17a95 100644 +--- a/ui/qt/iax2_analysis_dialog.cpp ++++ b/ui/qt/iax2_analysis_dialog.cpp +@@ -37,6 +37,7 @@ + #include "ui/rtp_stream.h" + #endif + #include ++#include /* for get_tmp_dir() */ + + #include + #include +@@ -271,10 +272,10 @@ Iax2AnalysisDialog::Iax2AnalysisDialog(QWidget &parent, CaptureFile &cf) : + + // We keep our temp files open for the lifetime of the dialog. The GTK+ + // UI opens and closes at various points. +- QString tempname = QString("%1/wireshark_iax2_f").arg(QDir::tempPath()); ++ QString tempname = QString("%1/wireshark_iax2_f").arg(get_tmp_dir()); + fwd_tempfile_ = new QTemporaryFile(tempname, this); + fwd_tempfile_->open(); +- tempname = QString("%1/wireshark_iax2_r").arg(QDir::tempPath()); ++ tempname = QString("%1/wireshark_iax2_r").arg(get_tmp_dir()); + rev_tempfile_ = new QTemporaryFile(tempname, this); + rev_tempfile_->open(); + +diff --git a/ui/qt/rtp_analysis_dialog.cpp b/ui/qt/rtp_analysis_dialog.cpp +index 5d82e46..8008984 100644 +--- a/ui/qt/rtp_analysis_dialog.cpp ++++ b/ui/qt/rtp_analysis_dialog.cpp +@@ -37,6 +37,7 @@ + + #include + #include ++#include /* for get_tmp_dir() */ + + #include + #include +@@ -331,10 +332,10 @@ RtpAnalysisDialog::RtpAnalysisDialog(QWidget &parent, CaptureFile &cf, struct _r + + // We keep our temp files open for the lifetime of the dialog. The GTK+ + // UI opens and closes at various points. +- QString tempname = QString("%1/wireshark_rtp_f").arg(QDir::tempPath()); ++ QString tempname = QString("%1/wireshark_rtp_f").arg(get_tmp_dir()); + fwd_tempfile_ = new QTemporaryFile(tempname, this); + fwd_tempfile_->open(); +- tempname = QString("%1/wireshark_rtp_r").arg(QDir::tempPath()); ++ tempname = QString("%1/wireshark_rtp_r").arg(get_tmp_dir()); + rev_tempfile_ = new QTemporaryFile(tempname, this); + rev_tempfile_->open(); + +diff --git a/ui/qt/rtp_audio_stream.cpp b/ui/qt/rtp_audio_stream.cpp +index fde66c8..b9531d2 100644 +--- a/ui/qt/rtp_audio_stream.cpp ++++ b/ui/qt/rtp_audio_stream.cpp +@@ -37,6 +37,7 @@ + #include + + #include ++#include /* for get_tmp_dir() */ + + #include + #include +@@ -76,7 +77,7 @@ RtpAudioStream::RtpAudioStream(QObject *parent, _rtp_stream_info *rtp_stream) : + visual_sample_rate_, SPEEX_RESAMPLER_QUALITY_MIN, NULL); + speex_resampler_skip_zeros(visual_resampler_); + +- QString tempname = QString("%1/wireshark_rtp_stream").arg(QDir::tempPath()); ++ QString tempname = QString("%1/wireshark_rtp_stream").arg(get_tmp_dir()); + tempfile_ = new QTemporaryFile(tempname, this); + tempfile_->open(); + +diff --git a/wsutil/Makefile.am b/wsutil/Makefile.am +index 2af1b6c..aa149a2 100644 +--- a/wsutil/Makefile.am ++++ b/wsutil/Makefile.am +@@ -90,6 +90,7 @@ WSUTIL_PUBLIC_INCLUDES = \ + ws_pipe.h \ + ws_printf.h \ + wsjsmn.h \ ++ wstmpdir.h \ + wsgcrypt.h \ + wsgetopt.h \ + wspcap.h \ +@@ -168,6 +169,7 @@ libwsutil_la_SOURCES = \ + ws_pipe.c \ + wsgcrypt.c \ + wsjsmn.c \ ++ wstmpdir.c \ + xtea.c + + if HAVE_PLUGINS +diff --git a/wsutil/tempfile.c b/wsutil/tempfile.c +index 8e1f8dc..dcf2f78 100644 +--- a/wsutil/tempfile.c ++++ b/wsutil/tempfile.c +@@ -36,6 +36,7 @@ + + #include "tempfile.h" + #include ++#include /* for get_tmp_dir() */ + + #ifndef __set_errno + #define __set_errno(x) errno=(x) +@@ -83,13 +83,14 @@ mkstemps(char *path_template, int suffixlen) + */ + char *get_tempfile_path(const char *filename) + { +- return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", g_get_tmp_dir(), filename); ++ return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", get_tmp_dir(), filename); + } + + #define MAX_TEMPFILES 3 + + /** +- * Create a tempfile with the given prefix (e.g. "wireshark"). ++ * Create a tempfile with the given prefix (e.g. "wireshark"). The path ++ * is created using get_tmp_dir and mkdtemp + * + * @param namebuf If not NULL, receives the full path of the temp file. + * Should NOT be freed. +@@ -199,7 +200,7 @@ create_tempfile(char **namebuf, const char *pfx, const char *sfx) + tf[idx].path = (char *)g_malloc(tf[idx].len); + } + +- tmp_dir = g_get_tmp_dir(); ++ tmp_dir = get_tmp_dir(); + + #ifdef _WIN32 + _tzset(); +diff --git a/wsutil/tempfile.h b/wsutil/tempfile.h +index 1dca2df..bb3160c 100644 +--- a/wsutil/tempfile.h ++++ b/wsutil/tempfile.h +@@ -45,7 +45,7 @@ WS_DLL_PUBLIC char *get_tempfile_path(const char *filename); + + /** + * Create a tempfile with the given prefix (e.g. "wireshark"). The path +- * is created using g_get_tmp_dir and mkstemp. ++ * is created using get_tmp_dir and mkstemp. + * + * @param namebuf [in,out] If not NULL, receives the full path of the temp file. + * Must NOT be freed. +diff --git a/wsutil/wstmpdir.c b/wsutil/wstmpdir.c +new file mode 100644 +index 0000000..d8b733b +--- /dev/null ++++ b/wsutil/wstmpdir.c +@@ -0,0 +1,70 @@ ++/* wstmpdir.c ++ * ++ * Copyright (C) 2013 Red Hat, Inc. All right reserved. ++ * ++ * Temporary directory routine ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version 2 ++ * of the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Author: Peter Hatina ++ */ ++ ++#include "config.h" ++ ++#include ++#include "wstmpdir.h" ++ ++/** ++ * Gets the directory to use for temporary files. ++ * ++ * Inspired by glib-2.0. If no TMP, TEMP or TMPDIR is set, ++ * /var/tmp is returned (Fedora specific). ++ * ++ * Returns: the directory to use for temporary files. ++ */ ++const char *get_tmp_dir(void) ++{ ++ static gchar *tmp_dir; ++ ++ if (g_once_init_enter(&tmp_dir)) { ++ gchar *tmp; ++ ++ tmp = g_strdup(g_getenv("TEMP")); ++ if (tmp == NULL || *tmp == '\0') { ++ g_free(tmp); ++ tmp = g_strdup(g_getenv("TMPDIR")); ++ } ++ ++#ifdef P_tmpdir ++ if (tmp == NULL || *tmp == '\0') { ++ gsize k; ++ g_free(tmp); ++ tmp = g_strdup(P_tmpdir); ++ k = strlen(tmp); ++ if (k > 1 && G_IS_DIR_SEPARATOR(tmp[k - 1])) ++ tmp[k - 1] = '\0'; ++ } ++#endif /* P_tmpdir */ ++ ++ if (tmp == NULL || *tmp == '\0') { ++ g_free(tmp); ++ tmp = g_strdup("/var/tmp"); ++ } ++ ++ g_once_init_leave(&tmp_dir, tmp); ++ } ++ ++ return tmp_dir; ++} +diff --git a/wsutil/wstmpdir.h b/wsutil/wstmpdir.h +new file mode 100644 +index 0000000..07ac583 +--- /dev/null ++++ b/wsutil/wstmpdir.h +@@ -0,0 +1,39 @@ ++/* wstmpdir.c ++ * ++ * Copyright (C) 2013 Red Hat, Inc. All right reserved. ++ * ++ * Temporary directory routine ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version 2 ++ * of the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Author: Peter Hatina ++ */ ++ ++#ifndef __WS_TMP_DIR_H__ ++#define __WS_TMP_DIR_H__ ++ ++#include "ws_symbol_export.h" ++ ++#ifdef __cplusplus ++extern "C" { ++#endif // __cplusplus ++ ++WS_DLL_PUBLIC const char *get_tmp_dir(void); ++ ++#ifdef __cplusplus ++} ++#endif // __cplusplus ++ ++#endif +-- +2.13.0 + diff --git a/wireshark-0007-cmakelists.patch b/wireshark-0007-cmakelists.patch new file mode 100644 index 0000000..07919f0 --- /dev/null +++ b/wireshark-0007-cmakelists.patch @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9e3b555..b0abd84 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3069,7 +3069,7 @@ if(RPMBUILD_EXECUTABLE AND GIT_EXECUTABLE) + endif() + + execute_process( +- COMMAND git describe --abbrev=8 --match v[1-9]* ++ COMMAND git describe --always --abbrev=8 --match v[1-9]* + OUTPUT_VARIABLE _git_description + OUTPUT_STRIP_TRAILING_WHITESPACE + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} +diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt +index 0367cd1..6382a2c 100644 +--- a/wsutil/CMakeLists.txt ++++ b/wsutil/CMakeLists.txt +@@ -69,6 +69,7 @@ set(WSUTIL_PUBLIC_HEADERS + ws_mempbrk_int.h + ws_pipe.h + ws_printf.h ++ wstmpdir.h + wsjsmn.h + xtea.h + ) +@@ -118,6 +118,7 @@ set(WSUTIL_COMMON_FILES + unicode-utils.c + ws_mempbrk.c + ws_pipe.c ++ wstmpdir.c + wsgcrypt.c + wsjsmn.c + xtea.c diff --git a/wireshark-0008-CVE-2018-16056.patch b/wireshark-0008-CVE-2018-16056.patch new file mode 100644 index 0000000..99944a8 --- /dev/null +++ b/wireshark-0008-CVE-2018-16056.patch @@ -0,0 +1,86 @@ +diff --git a/epan/dissectors/packet-btatt.c b/epan/dissectors/packet-btatt.c +index 803ed14f92..10375c0046 100644 +--- a/epan/dissectors/packet-btatt.c ++++ b/epan/dissectors/packet-btatt.c +@@ -4205,6 +4205,19 @@ dissect_handle(proto_tree *tree, packet_info *pinfo, gint hf, + static gint + btatt_dissect_attribute_handle(guint16 handle, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, btatt_data_t *att_data); + ++static int ++btatt_call_dissector_by_dissector_name_with_data(const char *dissector_name, ++ tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) ++{ ++ dissector_handle_t handle; ++ ++ handle = find_dissector(dissector_name); ++ if (handle != NULL) ++ return call_dissector_with_data(handle, tvb, pinfo, tree, data); ++ else ++ return call_data_dissector(tvb, pinfo, tree); ++} ++ + static gint + dissect_attribute_value(proto_tree *tree, proto_item *patron_item, packet_info *pinfo, tvbuff_t *old_tvb, + gint old_offset, gint length, guint16 handle, bluetooth_uuid_t uuid, btatt_data_t *att_data) +@@ -4728,7 +4741,7 @@ dissect_attribute_value(proto_tree *tree, proto_item *patron_item, packet_info * + proto_tree_add_item(tree, hf_btatt_value_trigger_setting_analog, tvb, offset, 2, ENC_LITTLE_ENDIAN); + offset += 2; + } else if (value == 4) { +- call_dissector_with_data(find_dissector("btgatt.uuid0x2a56"), tvb_new_subset_length_caplen(tvb, offset, 1, 1), pinfo, tree, att_data); ++ btatt_call_dissector_by_dissector_name_with_data("btgatt.uuid0x2a56", tvb_new_subset_length_caplen(tvb, offset, 1, 1), pinfo, tree, att_data); + offset += 1; + } else if (value == 5 || value == 6) { + proto_tree_add_item(tree, hf_btatt_value_trigger_setting_analog_one, tvb, offset, 2, ENC_LITTLE_ENDIAN); +@@ -6443,10 +6456,10 @@ dissect_attribute_value(proto_tree *tree, proto_item *patron_item, packet_info * + if (bluetooth_gatt_has_no_parameter(att_data->opcode)) + break; + +- call_dissector_with_data(find_dissector("btgatt.uuid0x2a56"), tvb_new_subset_length_caplen(tvb, offset, 1, 1), pinfo, tree, att_data); ++ btatt_call_dissector_by_dissector_name_with_data("btgatt.uuid0x2a56", tvb_new_subset_length_caplen(tvb, offset, 1, 1), pinfo, tree, att_data); + offset += 1; + +- call_dissector_with_data(find_dissector("btgatt.uuid0x2a58"), tvb_new_subset_length_caplen(tvb, offset, 2, 2), pinfo, tree, att_data); ++ btatt_call_dissector_by_dissector_name_with_data("btgatt.uuid0x2a58", tvb_new_subset_length_caplen(tvb, offset, 2, 2), pinfo, tree, att_data); + offset += 2; + + break; +@@ -6543,7 +6556,7 @@ dissect_attribute_value(proto_tree *tree, proto_item *patron_item, packet_info * + sub_item = proto_tree_add_item(tree, hf_btatt_plx_spot_check_measurement_timestamp, tvb, offset, 7, ENC_NA); + sub_tree = proto_item_add_subtree(sub_item, ett_btatt_value); + +- call_dissector_with_data(find_dissector("btgatt.uuid0x2a08"), tvb_new_subset_length_caplen(tvb, offset, 7, 7), pinfo, sub_tree, att_data); ++ btatt_call_dissector_by_dissector_name_with_data("btgatt.uuid0x2a08", tvb_new_subset_length_caplen(tvb, offset, 7, 7), pinfo, sub_tree, att_data); + offset += 7; + } + +@@ -9116,7 +9129,7 @@ dissect_attribute_value(proto_tree *tree, proto_item *patron_item, packet_info * + sub_item = proto_tree_add_item(tree, hf_btatt_ots_object_first_created, tvb, offset, 7, ENC_NA); + sub_tree = proto_item_add_subtree(sub_item, ett_btatt_value); + +- call_dissector_with_data(find_dissector("btgatt.uuid0x2a08"), tvb_new_subset_length_caplen(tvb, offset, 7, 7), pinfo, sub_tree, att_data); ++ btatt_call_dissector_by_dissector_name_with_data("btgatt.uuid0x2a08", tvb_new_subset_length_caplen(tvb, offset, 7, 7), pinfo, sub_tree, att_data); + offset += 7; + + break; +@@ -9135,7 +9148,7 @@ dissect_attribute_value(proto_tree *tree, proto_item *patron_item, packet_info * + sub_item = proto_tree_add_item(tree, hf_btatt_ots_object_last_modified, tvb, offset, 7, ENC_NA); + sub_tree = proto_item_add_subtree(sub_item, ett_btatt_value); + +- call_dissector_with_data(find_dissector("btgatt.uuid0x2a08"), tvb_new_subset_length_caplen(tvb, offset, 7, 7), pinfo, sub_tree, att_data); ++ btatt_call_dissector_by_dissector_name_with_data("btgatt.uuid0x2a08", tvb_new_subset_length_caplen(tvb, offset, 7, 7), pinfo, sub_tree, att_data); + offset += 7; + + break; +@@ -9342,10 +9355,10 @@ dissect_attribute_value(proto_tree *tree, proto_item *patron_item, packet_info * + break; + case 0x06: /* Created Between */ + case 0x07: /* Modified Between */ +- call_dissector_with_data(find_dissector("btgatt.uuid0x2a08"), tvb_new_subset_length_caplen(tvb, offset, 7, 7), pinfo, tree, att_data); ++ btatt_call_dissector_by_dissector_name_with_data("btgatt.uuid0x2a08", tvb_new_subset_length_caplen(tvb, offset, 7, 7), pinfo, tree, att_data); + offset += 7; + +- call_dissector_with_data(find_dissector("btgatt.uuid0x2a08"), tvb_new_subset_length_caplen(tvb, offset, 7, 7), pinfo, tree, att_data); ++ btatt_call_dissector_by_dissector_name_with_data("btgatt.uuid0x2a08", tvb_new_subset_length_caplen(tvb, offset, 7, 7), pinfo, tree, att_data); + offset += 7; + + break; diff --git a/wireshark-0009-CVE-2018-16057.patch b/wireshark-0009-CVE-2018-16057.patch new file mode 100644 index 0000000..faaf59f --- /dev/null +++ b/wireshark-0009-CVE-2018-16057.patch @@ -0,0 +1,27 @@ +diff --git a/epan/dissectors/packet-ieee80211-radiotap-iter.c b/epan/dissectors/packet-ieee80211-radiotap-iter.c +index 56ca297434..4006637fb2 100644 +--- a/epan/dissectors/packet-ieee80211-radiotap-iter.c ++++ b/epan/dissectors/packet-ieee80211-radiotap-iter.c +@@ -131,6 +131,7 @@ int ieee80211_radiotap_iterator_init( + iterator->_bitmap_shifter = get_unaligned_le32(&radiotap_header->it_present); + iterator->_arg = (guint8 *)radiotap_header + sizeof(*radiotap_header); + iterator->_reset_on_ext = 0; ++ iterator->_next_ns_data = NULL; + iterator->_next_bitmap = &radiotap_header->it_present; + iterator->_next_bitmap++; + iterator->_vns = vns; +@@ -287,9 +288,14 @@ int ieee80211_radiotap_iterator_next( + } + if (!align) { + /* skip all subsequent data */ ++ if (!iterator->_next_ns_data) ++ return -EINVAL; + iterator->_arg = iterator->_next_ns_data; + /* give up on this namespace */ + iterator->current_namespace = NULL; ++ iterator->_next_ns_data = NULL; ++ if (!ITERATOR_VALID(iterator, 0)) ++ return -EINVAL; + goto next_entry; + } + break; diff --git a/wireshark-0010-CVE-2018-16058.patch b/wireshark-0010-CVE-2018-16058.patch new file mode 100644 index 0000000..cc1d629 --- /dev/null +++ b/wireshark-0010-CVE-2018-16058.patch @@ -0,0 +1,19 @@ +diff --git a/epan/dissectors/packet-btavdtp.c b/epan/dissectors/packet-btavdtp.c +index a0df20a2de..4078228177 100644 +--- a/epan/dissectors/packet-btavdtp.c ++++ b/epan/dissectors/packet-btavdtp.c +@@ -719,13 +719,11 @@ dissect_sep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset, + key[6].length = 0; + key[6].key = NULL; + +- sep_data = wmem_new(wmem_file_scope(), sep_entry_t); ++ sep_data = wmem_new0(wmem_file_scope(), sep_entry_t); + sep_data->seid = seid; + sep_data->type = type; + sep_data->media_type = media_type; +- sep_data->int_seid = 0; + sep_data->codec = -1; +- sep_data->content_protection_type = 0; + if (in_use) { + sep_data->state = SEP_STATE_IN_USE; + } else { diff --git a/wireshark-0011-tshark-missing-N-option.patch b/wireshark-0011-tshark-missing-N-option.patch new file mode 100644 index 0000000..88285cc --- /dev/null +++ b/wireshark-0011-tshark-missing-N-option.patch @@ -0,0 +1,170 @@ +From 8dfaa8fa7c97cd1372a0a233b83fbc7945447b75 Mon Sep 17 00:00:00 2001 +From: Uli Heilmeier +Date: Fri, 05 Oct 2018 08:54:55 +0200 +Subject: [PATCH] *shark: Update help and manpage for name resolving + +Add 'v' option for VLAN ID resolving and get rid of +deprecated 'C' option. + +Bug: 14826 +Change-Id: I63104f4a465d251048693ad02882ea7eb2c4d926 +Reviewed-on: https://code.wireshark.org/review/30029 +Petri-Dish: Anders Broman +Tested-by: Petri Dish Buildbot +Reviewed-by: Anders Broman +--- + +diff --git a/doc/rawshark.pod b/doc/rawshark.pod +index be6caee..8f10445 100644 +--- a/doc/rawshark.pod ++++ b/doc/rawshark.pod +@@ -183,6 +183,8 @@ + + B to enable resolution from captured DNS packets + ++B to enable VLAN IDs to names resolution ++ + =item -o EpreferenceE:EvalueE + + Set a preference value, overriding the default value and any value read +diff --git a/doc/tshark.pod b/doc/tshark.pod +index 263332b..8aff736 100644 +--- a/doc/tshark.pod ++++ b/doc/tshark.pod +@@ -676,6 +676,8 @@ + + B to enable transport-layer port number resolution + ++B to enable VLAN IDs to names resolution ++ + =item -o EpreferenceE:EvalueE + + Set a preference value, overriding the default value and any value read +diff --git a/doc/wireshark.pod.template b/doc/wireshark.pod.template +index a25ea65..c45581f 100644 +--- a/doc/wireshark.pod.template ++++ b/doc/wireshark.pod.template +@@ -499,6 +499,8 @@ + + B to enable resolution from captured DNS packets + ++B to enable VLAN IDs to names resolution ++ + =item -o Epreference/recent settingE + + Set a preference or recent value, overriding the default value and any value +diff --git a/docbook/wsug_src/WSUG_chapter_customize.asciidoc b/docbook/wsug_src/WSUG_chapter_customize.asciidoc +index 67afafc..a7411c4 100644 +--- a/docbook/wsug_src/WSUG_chapter_customize.asciidoc ++++ b/docbook/wsug_src/WSUG_chapter_customize.asciidoc +@@ -76,7 +76,7 @@ + Processing: + -R packet filter in Wireshark display filter syntax + -n disable all name resolutions (def: all enabled) +- -N enable specific name resolution(s): "mnNtCd" ++ -N enable specific name resolution(s): "mnNtdv" + -d ==, ... + "Decode As”, see the man page for details + Example: tcp.port==8888,http +@@ -295,6 +295,7 @@ + resolution, `n` to enable network address resolution, and `t` to enable + transport-layer port number resolution. This overrides `-n` if both `-N` and + `-n` are present. The letter `d` enables resolution from captured DNS packets. ++The letter `v` enables resolution from VLAN IDs to names. + + -o :: + +diff --git a/docbook/wsug_src/rawshark-h.txt b/docbook/wsug_src/rawshark-h.txt +index 39aeec0..7de64ec 100644 +--- a/docbook/wsug_src/rawshark-h.txt ++++ b/docbook/wsug_src/rawshark-h.txt +@@ -13,7 +13,7 @@ + -F field to display + -m virtual memory limit, in bytes + -n disable all name resolution (def: all enabled) +- -N enable specific name resolution(s): "mnNtd" ++ -N enable specific name resolution(s): "mnNtdv" + -p use the system's packet header format + (which may have 64-bit timestamps) + -R packet filter in Wireshark display filter syntax +diff --git a/docbook/wsug_src/tshark-h.txt b/docbook/wsug_src/tshark-h.txt +index 9eaccda..ffe12b9 100644 +--- a/docbook/wsug_src/tshark-h.txt ++++ b/docbook/wsug_src/tshark-h.txt +@@ -38,7 +38,7 @@ + -Y packet displaY filter in Wireshark display filter + syntax + -n disable all name resolutions (def: all enabled) +- -N enable specific name resolution(s): "mnNtCd" ++ -N enable specific name resolution(s): "mnNtdv" + -d ==, ... + "Decode As", see the man page for details + Example: tcp.port==8888,http +diff --git a/epan/prefs.c b/epan/prefs.c +index 34c05d3..d732eb2 100644 +--- a/epan/prefs.c ++++ b/epan/prefs.c +@@ -4932,10 +4932,6 @@ + case 't': + name_resolve->transport_name = TRUE; + break; +- case 'C': +- /* DEPRECATED */ +- /* name_resolve->concurrent_dns */ +- break; + case 'd': + name_resolve->dns_pkt_addr_resolution = TRUE; + break; +diff --git a/rawshark.c b/rawshark.c +index 61875c1..29cb2ba 100644 +--- a/rawshark.c ++++ b/rawshark.c +@@ -190,7 +190,7 @@ + fprintf(output, " -m virtual memory limit, in bytes\n"); + #endif + fprintf(output, " -n disable all name resolution (def: all enabled)\n"); +- fprintf(output, " -N enable specific name resolution(s): \"mnNtd\"\n"); ++ fprintf(output, " -N enable specific name resolution(s): \"mnNtdv\"\n"); + fprintf(output, " -p use the system's packet header format\n"); + fprintf(output, " (which may have 64-bit timestamps)\n"); + fprintf(output, " -R packet filter in Wireshark display filter syntax\n"); +diff --git a/tshark.c b/tshark.c +index a152c2b..2d84153 100644 +--- a/tshark.c ++++ b/tshark.c +@@ -370,7 +370,7 @@ + fprintf(output, " -Y packet displaY filter in Wireshark display filter\n"); + fprintf(output, " syntax\n"); + fprintf(output, " -n disable all name resolutions (def: all enabled)\n"); +- fprintf(output, " -N enable specific name resolution(s): \"mnNtCd\"\n"); ++ fprintf(output, " -N enable specific name resolution(s): \"mnNtdv\"\n"); + fprintf(output, " -d %s ...\n", DECODE_AS_ARG_TEMPLATE); + fprintf(output, " \"Decode As\", see the man page for details\n"); + fprintf(output, " Example: tcp.port==8888,http\n"); +diff --git a/ui/commandline.c b/ui/commandline.c +index 6a26be3..7c0768a 100644 +--- a/ui/commandline.c ++++ b/ui/commandline.c +@@ -123,7 +123,7 @@ + fprintf(output, "Processing:\n"); + fprintf(output, " -R packet filter in Wireshark display filter syntax\n"); + fprintf(output, " -n disable all name resolutions (def: all enabled)\n"); +- fprintf(output, " -N enable specific name resolution(s): \"mnNtd\"\n"); ++ fprintf(output, " -N enable specific name resolution(s): \"mnNtdv\"\n"); + fprintf(output, " -d %s ...\n", DECODE_AS_ARG_TEMPLATE); + fprintf(output, " \"Decode As\", see the man page for details\n"); + fprintf(output, " Example: tcp.port==8888,http\n"); +diff --git a/ui/dissect_opts.c b/ui/dissect_opts.c +index 77e7b58..c6aa771 100644 +--- a/ui/dissect_opts.c ++++ b/ui/dissect_opts.c +@@ -79,7 +79,8 @@ + "\t'n' to enable network address resolution\n" + "\t'N' to enable using external resolvers (e.g., DNS)\n" + "\t for network address resolution\n" +- "\t't' to enable transport-layer port number resolution"); ++ "\t't' to enable transport-layer port number resolution\n" ++ "\t'v' to enable VLAN IDs to names resolution"); + return FALSE; + } + break; diff --git a/wireshark-0012-CVE-12086.patch b/wireshark-0012-CVE-12086.patch new file mode 100644 index 0000000..6691a79 --- /dev/null +++ b/wireshark-0012-CVE-12086.patch @@ -0,0 +1,109 @@ +diff --git a/plugins/epan/opcua/opcua.c b/plugins/epan/opcua/opcua.c +index fc26d9f30d..4ca68a9e83 100644 +--- a/plugins/epan/opcua/opcua.c ++++ b/plugins/epan/opcua/opcua.c +@@ -38,7 +38,7 @@ void proto_reg_handoff_opcua(void); + /* declare parse function pointer */ + typedef int (*FctParse)(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset); + +-static int proto_opcua = -1; ++int proto_opcua = -1; + static dissector_handle_t opcua_handle; + /** Official IANA registered port for OPC UA Binary Protocol. */ + #define OPCUA_PORT_RANGE "4840" +diff --git a/plugins/epan/opcua/opcua_simpletypes.c b/plugins/epan/opcua/opcua_simpletypes.c +index a787f21c35..ab006b7552 100644 +--- a/plugins/epan/opcua/opcua_simpletypes.c ++++ b/plugins/epan/opcua/opcua_simpletypes.c +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include "opcua_simpletypes.h" + #include "opcua_hfindeces.h" + #include "opcua_statuscode.h" +@@ -80,6 +81,7 @@ + + /* Chosen arbitrarily */ + #define MAX_ARRAY_LEN 10000 ++#define MAX_NESTING_DEPTH 100 + + static int hf_opcua_diag_mask = -1; + static int hf_opcua_diag_mask_symbolicflag = -1; +@@ -168,6 +170,9 @@ int hf_opcua_resultMask_displayname = -1; + int hf_opcua_resultMask_typedefinition = -1; + + static expert_field ei_array_length = EI_INIT; ++static expert_field ei_nesting_depth = EI_INIT; ++ ++extern int proto_opcua; + + /** NodeId encoding mask table */ + static const value_string g_nodeidmasks[] = { +@@ -526,6 +531,7 @@ void registerSimpleTypes(int proto) + + static ei_register_info ei[] = { + { &ei_array_length, { "opcua.array.length", PI_UNDECODED, PI_ERROR, "Max array length exceeded", EXPFILL }}, ++ { &ei_nesting_depth, { "opcua.nestingdepth", PI_UNDECODED, PI_ERROR, "Max nesting depth exceeded", EXPFILL }}, + }; + + proto_register_field_array(proto, hf, array_length(hf)); +@@ -802,9 +808,19 @@ void parseDiagnosticInfo(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gi + guint8 EncodingMask; + proto_tree *subtree; + proto_item *ti; ++ guint opcua_nested_count; + + subtree = proto_tree_add_subtree_format(tree, tvb, *pOffset, -1, ett_opcua_diagnosticinfo, &ti, "%s: DiagnosticInfo", szFieldName); + ++ /* prevent a too high nesting depth */ ++ opcua_nested_count = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_opcua, 0)); ++ if (++opcua_nested_count > MAX_NESTING_DEPTH) ++ { ++ expert_add_info(pinfo, ti, &ei_nesting_depth); ++ return; ++ } ++ p_add_proto_data(pinfo->pool, pinfo, proto_opcua, 0, GUINT_TO_POINTER(opcua_nested_count)); ++ + /* parse encoding mask */ + EncodingMask = tvb_get_guint8(tvb, iOffset); + proto_tree_add_bitmask(subtree, tvb, iOffset, hf_opcua_diag_mask, ett_opcua_diagnosticinfo_encodingmask, diag_mask, ENC_LITTLE_ENDIAN); +@@ -912,6 +928,16 @@ void parseVariant(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOf + gint iOffset = *pOffset; + guint8 EncodingMask; + gint32 ArrayDimensions = 0; ++ guint opcua_nested_count; ++ ++ /* prevent a too high nesting depth */ ++ opcua_nested_count = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_opcua, 0)); ++ if (++opcua_nested_count > MAX_NESTING_DEPTH) ++ { ++ expert_add_info(pinfo, ti, &ei_nesting_depth); ++ return; ++ } ++ p_add_proto_data(pinfo->pool, pinfo, proto_opcua, 0, GUINT_TO_POINTER(opcua_nested_count)); + + EncodingMask = tvb_get_guint8(tvb, iOffset); + proto_tree_add_item(subtree, hf_opcua_variant_encodingmask, tvb, iOffset, 1, ENC_LITTLE_ENDIAN); +@@ -1167,10 +1193,20 @@ void parseExtensionObject(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, g + guint32 TypeId; + proto_tree *extobj_tree; + proto_item *ti; ++ guint opcua_nested_count; + + /* add extension object subtree */ + extobj_tree = proto_tree_add_subtree_format(tree, tvb, *pOffset, -1, ett_opcua_extensionobject, &ti, "%s: ExtensionObject", szFieldName); + ++ /* prevent a too high nesting depth */ ++ opcua_nested_count = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_opcua, 0)); ++ if (++opcua_nested_count > MAX_NESTING_DEPTH) ++ { ++ expert_add_info(pinfo, ti, &ei_nesting_depth); ++ return; ++ } ++ p_add_proto_data(pinfo->pool, pinfo, proto_opcua, 0, GUINT_TO_POINTER(opcua_nested_count)); ++ + /* add nodeid subtree */ + TypeId = getExtensionObjectType(tvb, &iOffset); + parseExpandedNodeId(extobj_tree, tvb, pinfo, &iOffset, "TypeId"); diff --git a/wireshark-0013-CVE-18225.patch b/wireshark-0013-CVE-18225.patch new file mode 100644 index 0000000..f6083da --- /dev/null +++ b/wireshark-0013-CVE-18225.patch @@ -0,0 +1,31 @@ +diff --git a/epan/dissectors/packet-coap.c b/epan/dissectors/packet-coap.c +index b37b6c231c..b7afe05f82 100644 +--- a/epan/dissectors/packet-coap.c ++++ b/epan/dissectors/packet-coap.c +@@ -450,8 +450,11 @@ dissect_coap_opt_object_security(tvbuff_t *tvb, proto_item *head_item, proto_tre + coinfo->object_security = TRUE; + + coinfo->oscore_info->piv = NULL; ++ coinfo->oscore_info->piv_len = 0; + coinfo->oscore_info->kid_context = NULL; ++ coinfo->oscore_info->kid_context_len = 0; + coinfo->oscore_info->kid = NULL; ++ coinfo->oscore_info->kid_len = 0; + + if (opt_length == 0) { /* option length is zero, means flag byte is 0x00*/ + /* add info to the head of the packet detail */ +@@ -1144,11 +1147,9 @@ dissect_coap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d + /* Indicate to OSCORE that this response contains its own PIV */ + coinfo->oscore_info->piv_in_response = TRUE; + coap_trans->oscore_info->piv_in_response = TRUE; +- } else { +- if (coap_trans->oscore_info->piv) { +- /* Use the PIV from the request */ +- coinfo->oscore_info->piv = (guint8 *) wmem_memdup(wmem_packet_scope(), coap_trans->oscore_info->piv, coap_trans->oscore_info->piv_len); +- } ++ } else if (coap_trans->oscore_info->piv_len > 0) { ++ /* Use the PIV from the request */ ++ coinfo->oscore_info->piv = (guint8 *) wmem_memdup(wmem_packet_scope(), coap_trans->oscore_info->piv, coap_trans->oscore_info->piv_len); + coinfo->oscore_info->piv_len = coap_trans->oscore_info->piv_len; + } + coinfo->oscore_info->response = TRUE; diff --git a/wireshark-0014-CVE-18226.patch b/wireshark-0014-CVE-18226.patch new file mode 100644 index 0000000..87c29a8 --- /dev/null +++ b/wireshark-0014-CVE-18226.patch @@ -0,0 +1,57 @@ +diff --git a/epan/dissectors/packet-steam-ihs-discovery.c b/epan/dissectors/packet-steam-ihs-discovery.c +index 1bec81e594..9d238f4e88 100644 +--- a/epan/dissectors/packet-steam-ihs-discovery.c ++++ b/epan/dissectors/packet-steam-ihs-discovery.c +@@ -491,9 +491,7 @@ steamdiscover_dissect_body_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree + protobuf_desc_t pb = { tvb, offset, bytes_left }; + protobuf_desc_t pb2 = { tvb, 0, 0 }; + protobuf_tag_t tag = { 0, 0, 0 }; +- wmem_allocator_t* strpool; + guint8 *hostname; +- strpool = wmem_allocator_new(WMEM_ALLOCATOR_SIMPLE); + nstime_t timestamp; + proto_tree *user_tree; + proto_item *user_it; +@@ -522,7 +520,7 @@ steamdiscover_dissect_body_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree + value = get_varint64(pb.tvb, pb.offset, pb.bytes_left, &len); + proto_tree_add_item(tree, hf_steam_ihs_discovery_body_status_hostname, pb.tvb, + pb.offset+len, (gint)value, ENC_UTF_8|ENC_NA); +- hostname = tvb_get_string_enc(strpool, pb.tvb, pb.offset+len, (gint)value, ENC_UTF_8); ++ hostname = tvb_get_string_enc(wmem_packet_scope(), pb.tvb, pb.offset+len, (gint)value, ENC_UTF_8); + if(hostname && strlen(hostname)) { + col_add_fstr(pinfo->cinfo, COL_INFO, "%s from %s", hf_steam_ihs_discovery_header_msgtype_strings[STEAMDISCOVER_MSGTYPE_CLIENTBROADCASTMSGSTATUS].strptr, hostname); + } +@@ -615,7 +613,6 @@ steamdiscover_dissect_body_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree + } + protobuf_seek_forward(&pb, len); + } +- wmem_destroy_allocator(strpool); + } + + /* Dissect a CMsgRemoteDeviceAuthorizationRequest protobuf message body. +@@ -648,8 +645,6 @@ steamdiscover_dissect_body_authrequest(tvbuff_t *tvb, packet_info *pinfo, proto_ + gint64 value; + protobuf_desc_t pb = { tvb, offset, bytes_left }; + protobuf_tag_t tag = { 0, 0, 0 }; +- wmem_allocator_t *strpool; +- strpool = wmem_allocator_new(WMEM_ALLOCATOR_SIMPLE); + guint8* devicename; + while (protobuf_iter_next(&pb, &tag)) { + switch(tag.field_number) { +@@ -665,7 +660,7 @@ steamdiscover_dissect_body_authrequest(tvbuff_t *tvb, packet_info *pinfo, proto_ + value = get_varint64(pb.tvb, pb.offset, pb.bytes_left, &len); + proto_tree_add_item(tree, hf_steam_ihs_discovery_body_authrequest_devicename, pb.tvb, + pb.offset+len, (gint)value, ENC_UTF_8|ENC_NA); +- devicename = tvb_get_string_enc(strpool, pb.tvb, pb.offset+len, (gint)value, ENC_UTF_8); ++ devicename = tvb_get_string_enc(wmem_packet_scope(), pb.tvb, pb.offset+len, (gint)value, ENC_UTF_8); + if (devicename && strlen(devicename)) { + col_append_fstr(pinfo->cinfo, COL_INFO, " from %s", devicename); + } +@@ -684,7 +679,6 @@ steamdiscover_dissect_body_authrequest(tvbuff_t *tvb, packet_info *pinfo, proto_ + } + protobuf_seek_forward(&pb, len); + } +- wmem_destroy_allocator(strpool); + } + + /* Dissect a CMsgRemoteDeviceAuthorizationResponse protobuf message body. diff --git a/wireshark-0015-CVE-18227.patch b/wireshark-0015-CVE-18227.patch new file mode 100644 index 0000000..02035d2 --- /dev/null +++ b/wireshark-0015-CVE-18227.patch @@ -0,0 +1,725 @@ +diff --git a/epan/dissectors/packet-mswsp.c b/epan/dissectors/packet-mswsp.c +index 421713067b..295192a0ab 100644 +--- a/epan/dissectors/packet-mswsp.c ++++ b/epan/dissectors/packet-mswsp.c +@@ -359,6 +359,7 @@ static int SMB2 = 2; + + void proto_reg_handoff_mswsp(void); + ++static expert_field ei_mswsp_invalid_variant_type = EI_INIT; + static expert_field ei_missing_msg_context = EI_INIT; + static expert_field ei_mswsp_msg_cpmsetbinding_ccolumns = EI_INIT; + +@@ -3068,7 +3069,7 @@ static int parse_lcid(tvbuff_t *tvb, int offset, proto_tree *parent_tree, const + + /*****************************************************************************************/ + /* 2.2.1.1 CBaseStorageVariant */ +-static int parse_CBaseStorageVariant(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CBaseStorageVariant *value, const char *text); ++static int parse_CBaseStorageVariant(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CBaseStorageVariant *value, const char *text); + + /* 2.2.1.2 CFullPropSpec */ + static int parse_CFullPropSpec(tvbuff_t *tvb, int offset, proto_tree *tree, proto_tree *pad_tree, struct CFullPropSpec *v, const char *fmt, ...); +@@ -3080,10 +3081,10 @@ static int parse_CContentRestriction(tvbuff_t *tvb, int offset, proto_tree *pare + static int parse_CNatLanguageRestriction(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CNatLanguageRestriction *v, const char *fmt, ...); + + /* 2.2.1.6 CNodeRestriction */ +-static int parse_CNodeRestriction(tvbuff_t *tvb, int offset, proto_tree *tree, proto_tree *pad_tree, struct CNodeRestriction *v, const char* fmt, ...); ++static int parse_CNodeRestriction(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree, proto_tree *pad_tree, struct CNodeRestriction *v, const char* fmt, ...); + + /* 2.2.1.7 CPropertyRestriction */ +-static int parse_CPropertyRestriction(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CPropertyRestriction *v, const char *fmt, ...); ++static int parse_CPropertyRestriction(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CPropertyRestriction *v, const char *fmt, ...); + + /* 2.2.1.8 CReuseWhere */ + static int parse_CReuseWhere(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree _U_, struct CReuseWhere *v, const char *fmt, ...); +@@ -3092,27 +3093,27 @@ static int parse_CReuseWhere(tvbuff_t *tvb, int offset, proto_tree *parent_tree, + static int parse_CSort(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree _U_, const char *fmt, ...); + + /* 2.2.1.12 CCoercionRestriction */ +-static int parse_CCoercionRestriction(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CCoercionRestriction *v, const char *fmt, ...); ++static int parse_CCoercionRestriction(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CCoercionRestriction *v, const char *fmt, ...); + /* 2.2.1.16 CRestrictionArray */ +-static int parse_CRestrictionArray(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); ++static int parse_CRestrictionArray(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); + + /* 2.2.1.17 CRestriction */ +-static int parse_CRestriction(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CRestriction *v, const char *fmt, ...); ++static int parse_CRestriction(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CRestriction *v, const char *fmt, ...); + + /* 2.2.1.18 CColumnSet */ + static int parse_CColumnSet(tvbuff_t *tvb, int offset, proto_tree *tree, const char *fmt, ...); + + /* 2.2.1.20 CCategorizationSpec */ +-static int parse_CCategorizationSpec(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); ++static int parse_CCategorizationSpec(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); + + /* 2.2.1.21 CCategSpec */ +-static int parse_CCategSpec(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); ++static int parse_CCategSpec(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); + + /* 2.2.1.22 CRangeCategSpec */ +-static int parse_CRangeCategSpec(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); ++static int parse_CRangeCategSpec(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); + + /* 2.2.1.23 RANGEBOUNDARY */ +-static int parse_RANGEBOUNDARY(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); ++static int parse_RANGEBOUNDARY(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); + + /* 2.2.1.24 CAggregSet */ + static int parse_CAggregSet(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); +@@ -3127,19 +3128,19 @@ static int parse_CSortAggregSet(tvbuff_t *tvb, int offset, proto_tree *parent_tr + static int parse_CAggregSortKey(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); + + /* 2.2.1.28 CInGroupSortAggregSets */ +-static int parse_CInGroupSortAggregSets(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); ++static int parse_CInGroupSortAggregSets(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); + + /* 2.2.1.29 CInGroupSortAggregSet */ +-static int parse_CInGroupSortAggregSet(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); ++static int parse_CInGroupSortAggregSet(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); + + /* 2.2.1.30 CDbColId */ + static int parse_CDbColId(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *text); + + /* 2.2.1.31 CDbProp */ +-static int parse_CDbProp(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct GuidPropertySet *propset, const char *fmt, ...); ++static int parse_CDbProp(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct GuidPropertySet *propset, const char *fmt, ...); + + /* 2.2.1.32 CDbPropSet */ +-static int parse_CDbPropSet(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); ++static int parse_CDbPropSet(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); + + /* 2.2.1.33 CPidMapper */ + static int parse_CPidMapper(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); +@@ -3157,7 +3158,7 @@ static int parse_CRowsetProperties(tvbuff_t *tvb, int offset, proto_tree *parent + static int parse_CSortSet(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...); + + /* 2.2.1.44 CTableColumn */ +-static int parse_CTableColumn(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CTableColumn *col, const char *fmt, ...); ++static int parse_CTableColumn(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CTableColumn *col, const char *fmt, ...); + + + /* +@@ -3231,11 +3232,11 @@ static int parse_CSortSet(tvbuff_t *tvb, int offset, proto_tree *parent_tree, pr + return offset; + } + +-static int parse_CTableColumn(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CTableColumn *col, const char *fmt, ...) ++static int parse_CTableColumn(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CTableColumn *col, const char *fmt, ...) + { + + +- proto_item *item; ++ proto_item *item, *ti_type; + proto_tree *tree; + va_list ap; + struct vtype_data *type; +@@ -3266,8 +3267,14 @@ static int parse_CTableColumn(tvbuff_t *tvb, int offset, proto_tree *parent_tree + } + } + type = vType_get_type(vtype_val); +- DISSECTOR_ASSERT(type != NULL); +- proto_tree_add_string_format_value(tree, hf_mswsp_ctablecolumn_vtype, tvb, offset, 4, type->str, "%s%s", type->str, modifier); ++ if (type == NULL) { ++ /* ++ * Not a valid type. ++ */ ++ ti_type = proto_tree_add_string(tree, hf_mswsp_ctablecolumn_vtype, tvb, offset, 4, "Unknown CTableColumn type"); ++ expert_add_info(pinfo, ti_type, &ei_mswsp_invalid_variant_type); ++ } else ++ proto_tree_add_string_format_value(tree, hf_mswsp_ctablecolumn_vtype, tvb, offset, 4, type->str, "%s%s", type->str, modifier); + offset += 4; + + used = tvb_get_guint8(tvb, offset); +@@ -3487,7 +3494,7 @@ static int parse_relop(tvbuff_t *tvb, int offset, proto_tree *tree, guint32 *re + } + return offset + 4; + } +-static int parse_CPropertyRestriction(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CPropertyRestriction *v, const char *fmt, ...) ++static int parse_CPropertyRestriction(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CPropertyRestriction *v, const char *fmt, ...) + { + proto_tree *tree; + proto_item *item; +@@ -3505,7 +3512,7 @@ static int parse_CPropertyRestriction(tvbuff_t *tvb, int offset, proto_tree *par + + offset = parse_CFullPropSpec(tvb, offset, tree, pad_tree, &v->property, "Property"); + +- offset = parse_CBaseStorageVariant(tvb, offset, tree, pad_tree, &v->prval, "prval"); ++ offset = parse_CBaseStorageVariant(tvb, pinfo, offset, tree, pad_tree, &v->prval, "prval"); + + offset = parse_padding(tvb, offset, 4, pad_tree, "padding_lcid"); + +@@ -3517,7 +3524,7 @@ static int parse_CPropertyRestriction(tvbuff_t *tvb, int offset, proto_tree *par + return offset; + } + +-static int parse_CCoercionRestriction(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CCoercionRestriction *v, const char *fmt, ...) ++static int parse_CCoercionRestriction(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CCoercionRestriction *v, const char *fmt, ...) + { + proto_tree *tree; + proto_item *item; +@@ -3535,7 +3542,7 @@ static int parse_CCoercionRestriction(tvbuff_t *tvb, int offset, proto_tree *par + + offset += 4; + +- offset = parse_CRestriction(tvb, offset, tree, pad_tree, &v->child, "child"); ++ offset = parse_CRestriction(tvb, pinfo, offset, tree, pad_tree, &v->child, "child"); + + proto_item_set_end(item, tvb, offset); + return offset; +@@ -3732,7 +3739,7 @@ static int parse_rType(tvbuff_t *tvb, int offset, proto_tree *tree, enum rType * + return offset + 4; + } + +-static int parse_CRestriction(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CRestriction *v, const char *fmt, ...) ++static int parse_CRestriction(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct CRestriction *v, const char *fmt, ...) + { + proto_tree *tree; + proto_item *item; +@@ -3761,18 +3768,18 @@ static int parse_CRestriction(tvbuff_t *tvb, int offset, proto_tree *parent_tree + case RTProximity: + case RTPhrase: { + v->u.RTAnd = EP_ALLOC(struct CNodeRestriction); +- offset = parse_CNodeRestriction(tvb, offset, tree, pad_tree, v->u.RTAnd, "CNodeRestriction"); ++ offset = parse_CNodeRestriction(tvb, pinfo, offset, tree, pad_tree, v->u.RTAnd, "CNodeRestriction"); + break; + } + case RTNot: { + v->u.RTNot = EP_ALLOC(struct CRestriction); +- offset = parse_CRestriction(tvb, offset, tree, pad_tree, ++ offset = parse_CRestriction(tvb, pinfo, offset, tree, pad_tree, + v->u.RTNot, "CRestriction"); + break; + } + case RTProperty: { + v->u.RTProperty = EP_ALLOC(struct CPropertyRestriction); +- offset = parse_CPropertyRestriction(tvb, offset, tree, pad_tree, ++ offset = parse_CPropertyRestriction(tvb, pinfo, offset, tree, pad_tree, + v->u.RTProperty, "CPropertyRestriction"); + break; + } +@@ -3780,7 +3787,7 @@ static int parse_CRestriction(tvbuff_t *tvb, int offset, proto_tree *parent_tree + case RTCoerce_Multiply: + case RTCoerce_Absolute: { + v->u.RTCoerce_Add = EP_ALLOC(struct CCoercionRestriction); +- offset = parse_CCoercionRestriction(tvb, offset, tree, pad_tree, ++ offset = parse_CCoercionRestriction(tvb, pinfo, offset, tree, pad_tree, + v->u.RTCoerce_Add, "CCoercionRestriction"); + break; + } +@@ -3810,7 +3817,7 @@ static int parse_CRestriction(tvbuff_t *tvb, int offset, proto_tree *parent_tree + return offset; + } + +-static int parse_CRestrictionArray(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...) ++static int parse_CRestrictionArray(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...) + { + guint8 present, count; + +@@ -3840,14 +3847,14 @@ static int parse_CRestrictionArray(tvbuff_t *tvb, int offset, proto_tree *parent + + for (i=0; icNode; i++) { + struct CRestriction r; + ZERO_STRUCT(r); +- offset = parse_CRestriction(tvb, offset, tree, pad_tree, &r, "paNode[%u]", i); ++ offset = parse_CRestriction(tvb, pinfo, offset, tree, pad_tree, &r, "paNode[%u]", i); + offset = parse_padding(tvb, offset, 4, tree, "padding_paNode[%u]", i); /*at begin or end of loop ????*/ + + } +@@ -4208,117 +4215,7 @@ static const char *str_CBaseStorageVariant(struct CBaseStorageVariant *value, gb + return wmem_strbuf_get_str(strbuf); + } + +-static int parse_vType(tvbuff_t *tvb, int offset, guint16 *vtype) +-{ +- guint16 tmp_vtype = tvb_get_letohs(tvb, offset); +- guint16 modifier = tmp_vtype & 0xFF00; +- +- switch (tmp_vtype & 0xFF) { +- case VT_EMPTY: +- *vtype = VT_EMPTY; +- break; +- case VT_NULL: +- *vtype = VT_NULL; +- break; +- case VT_I2: +- *vtype = VT_I2; +- break; +- case VT_I4: +- *vtype = VT_I4; +- break; +- case VT_R4: +- *vtype = VT_R4; +- break; +- case VT_R8: +- *vtype = VT_R8; +- break; +- case VT_CY: +- *vtype = VT_CY; +- break; +- case VT_DATE: +- *vtype = VT_DATE; +- break; +- case VT_BSTR: +- *vtype = VT_BSTR; +- break; +- case VT_ERROR: +- *vtype = VT_ERROR; +- break; +- case VT_BOOL: +- *vtype = VT_BOOL; +- break; +- case VT_VARIANT: +- *vtype = VT_VARIANT; +- break; +- case VT_DECIMAL: +- *vtype = VT_DECIMAL; +- break; +- case VT_I1: +- *vtype = VT_I1; +- break; +- case VT_UI1: +- *vtype = VT_UI1; +- break; +- case VT_UI2: +- *vtype = VT_UI2; +- break; +- case VT_UI4: +- *vtype = VT_UI4; +- break; +- case VT_I8: +- *vtype = VT_I8; +- break; +- case VT_UI8: +- *vtype = VT_UI8; +- break; +- case VT_INT: +- *vtype = VT_INT; +- break; +- case VT_UINT: +- *vtype = VT_UINT; +- break; +- case VT_LPSTR: +- *vtype = VT_LPSTR; +- break; +- case VT_LPWSTR: +- *vtype = VT_LPWSTR; +- break; +- case VT_COMPRESSED_LPWSTR: +- *vtype = VT_COMPRESSED_LPWSTR; +- break; +- case VT_FILETIME: +- *vtype = VT_FILETIME; +- break; +- case VT_BLOB: +- *vtype = VT_BLOB; +- break; +- case VT_BLOB_OBJECT: +- *vtype = VT_BLOB_OBJECT; +- break; +- case VT_CLSID: +- *vtype = VT_CLSID; +- break; +- default: +- DISSECTOR_ASSERT(FALSE); +- break; +- } +- if (modifier) { +- switch (modifier) { +- case VT_VECTOR: +- *vtype |= VT_VECTOR; +- break; +- case VT_ARRAY: +- *vtype |= VT_ARRAY; +- break; +- default: +- DISSECTOR_ASSERT(FALSE); +- break; +- } +- } +- return offset + 2; +-} +- +-static int parse_CBaseStorageVariant(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree _U_, struct CBaseStorageVariant *value, const char *text) ++static int parse_CBaseStorageVariant(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree _U_, struct CBaseStorageVariant *value, const char *text) + { + int i, len; + proto_item *ti, *ti_type, *ti_val; +@@ -4329,9 +4226,19 @@ static int parse_CBaseStorageVariant(tvbuff_t *tvb, int offset, proto_tree *pare + + tree = proto_tree_add_subtree(parent_tree, tvb, offset, 0, ett_CBaseStorageVariant, &ti, text); + +- parse_vType(tvb, offset, &value->vType); +- value->type = vType_get_type(value->vType); +- DISSECTOR_ASSERT(value->type != NULL); ++ value->vType = tvb_get_letohs(tvb, offset); ++ value->type = vType_get_type(value->vType & 0xFF); ++ if (value->type == NULL) { ++ /* ++ * Not a valid type. ++ */ ++ ti_type = proto_tree_add_string(tree, hf_mswsp_cbasestorvariant_vtype, tvb, offset, 2, "Unknown CBaseStorageVariant type"); ++ offset += 2; ++ expert_add_info(pinfo, ti_type, &ei_mswsp_invalid_variant_type); ++ ++ THROW_MESSAGE(ReportedBoundsError, "Unknown CBaseStorageVariant type"); ++ return offset; ++ } + + ti_type = proto_tree_add_string(tree, hf_mswsp_cbasestorvariant_vtype, tvb, offset, 2, value->type->str); + offset += 2; +@@ -4452,7 +4359,7 @@ static int parse_CDbColId(tvbuff_t *tvb, int offset, proto_tree *parent_tree, pr + return offset; + } + +-static int parse_CDbProp(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct GuidPropertySet *propset, const char *fmt, ...) ++static int parse_CDbProp(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, struct GuidPropertySet *propset, const char *fmt, ...) + { + static const value_string EMPTY_VS[] = {{0, NULL}}; + const value_string *vs = (propset && propset->id_map) ? propset->id_map : EMPTY_VS; +@@ -4485,7 +4392,7 @@ static int parse_CDbProp(tvbuff_t *tvb, int offset, proto_tree *parent_tree, pro + + offset = parse_CDbColId(tvb, offset, tree, pad_tree, "colid"); + +- offset = parse_CBaseStorageVariant(tvb, offset, tree, pad_tree, &value, "vValue"); ++ offset = parse_CBaseStorageVariant(tvb, pinfo, offset, tree, pad_tree, &value, "vValue"); + + str = str_CBaseStorageVariant(&value, TRUE); + proto_item_append_text(item, " %s", str); +@@ -4494,7 +4401,7 @@ static int parse_CDbProp(tvbuff_t *tvb, int offset, proto_tree *parent_tree, pro + return offset; + } + +-static int parse_CDbPropSet(tvbuff_t *tvb, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...) ++static int parse_CDbPropSet(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, proto_tree *pad_tree, const char *fmt, ...) + { + int i, num; + e_guid_t guid; +@@ -4530,14 +4437,14 @@ static int parse_CDbPropSet(tvbuff_t *tvb, int offset, proto_tree *parent_tree, + + for (i = 0; ivtype & 0x00FF)); + wmem_strbuf_t *strbuf; + +- DISSECTOR_ASSERT(vt_list_type != NULL); + offset = parse_CRowVariantArrayInfo(tvb, offset, tree, is_64bit, variant); + if (is_64bit) { + buf_offset = +@@ -5335,10 +5239,10 @@ static int parse_VariantColVector(tvbuff_t *tvb, int offset, proto_tree *tree, g + return offset; + } + +-static int parse_VariantCol(tvbuff_t *tvb, int offset, proto_tree *parent_tree, guint64 base_address, guint32 length _U_, gboolean is_64bit, struct CRowVariant *variant, const char *fmt, ...) ++static int parse_VariantCol(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, guint64 base_address, guint32 length _U_, gboolean is_64bit, struct CRowVariant *variant, const char *fmt, ...) + { + proto_tree *tree; +- proto_item *item; ++ proto_item *item, *ti_type; + + va_list ap; + struct vtype_data *vt_type; +@@ -5354,8 +5258,6 @@ static int parse_VariantCol(tvbuff_t *tvb, int offset, proto_tree *parent_tree, + + variant->vtype = tvb_get_letohs(tvb, offset); + vt_type = vType_get_type((enum vType)variant->vtype); +- DISSECTOR_ASSERT(vt_type != NULL); +- + vtype_high = (variant->vtype & 0xFF00); + if (vtype_high) { + if (vtype_high == VT_VECTOR) { +@@ -5367,6 +5269,17 @@ static int parse_VariantCol(tvbuff_t *tvb, int offset, proto_tree *parent_tree, + } + } + ++ if (vt_type == NULL) { ++ /* ++ * Not a valid type. ++ */ ++ ti_type = proto_tree_add_string(tree, hf_mswsp_ctablecolumn_vtype, tvb, offset, 4, "Unknown variant column type"); ++ expert_add_info(pinfo, ti_type, &ei_mswsp_invalid_variant_type); ++ offset += 2; ++ ++ THROW_FORMATTED(ReportedBoundsError, "Unknown variant column type%s", modifier); ++ return offset; ++ } + proto_tree_add_string_format_value(tree, hf_mswsp_rowvariant_vtype, tvb, offset, 2, vt_type->str, "%s%s", vt_type->str, modifier); + offset += 2; + +@@ -5382,7 +5295,7 @@ static int parse_VariantCol(tvbuff_t *tvb, int offset, proto_tree *parent_tree, + + if (vtype_high == VT_VECTOR || vtype_high == VT_ARRAY) { + offset = parse_VariantColVector(tvb, offset, tree, base_address, +- is_64bit, variant); ++ is_64bit, variant, vt_type); + } else { + wmem_strbuf_t *strbuf = wmem_strbuf_new(wmem_packet_scope(), ""); + if (size != -1) { +@@ -5421,7 +5334,7 @@ static int parse_VariantCol(tvbuff_t *tvb, int offset, proto_tree *parent_tree, + return offset; + } + +-static int parse_RowsBufferCol(tvbuff_t *tvb, int offset, guint32 row, guint32 col, struct CPMSetBindingsIn *bindingsin, struct rows_data *rowsin, gboolean b_is_64bit, proto_tree *parent_tree, const char *fmt, ...) ++static int parse_RowsBufferCol(tvbuff_t *tvb, packet_info *pinfo, int offset, guint32 row, guint32 col, struct CPMSetBindingsIn *bindingsin, struct rows_data *rowsin, gboolean b_is_64bit, proto_tree *parent_tree, const char *fmt, ...) + { + proto_tree *tree; + proto_item *item; +@@ -5463,13 +5376,13 @@ static int parse_RowsBufferCol(tvbuff_t *tvb, int offset, guint32 row, guint32 c + len = tvb_get_letohs(tvb, buf_offset + pcol->lengthoffset) - pcol->valuesize; + } + if (pcol->vtype == VT_VARIANT) { +- parse_VariantCol(tvb, tmp_offset, tree, base_address, len, b_is_64bit, &variant, "CRowVariant"); ++ parse_VariantCol(tvb, pinfo, tmp_offset, tree, base_address, len, b_is_64bit, &variant, "CRowVariant"); + } + } + return offset; + } + +-static int parse_RowsBuffer(tvbuff_t *tvb, int offset, guint32 num_rows, struct CPMSetBindingsIn *bindingsin, struct rows_data *rowsin, gboolean is64bit, proto_tree *parent_tree, const char *fmt, ...) ++static int parse_RowsBuffer(tvbuff_t *tvb, packet_info *pinfo, int offset, guint32 num_rows, struct CPMSetBindingsIn *bindingsin, struct rows_data *rowsin, gboolean is64bit, proto_tree *parent_tree, const char *fmt, ...) + { + proto_tree *tree; + proto_item *item; +@@ -5488,7 +5401,7 @@ static int parse_RowsBuffer(tvbuff_t *tvb, int offset, guint32 num_rows, struct + proto_tree *row_tree; + row_tree = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_GetRowsRow, NULL, "Row[%d]", num); + for (col = 0; col < bindingsin->ccolumns; col++) { +- parse_RowsBufferCol(tvb, offset, num, col, bindingsin, rowsin, is64bit, row_tree, "Col[%d]", col); ++ parse_RowsBufferCol(tvb, pinfo, offset, num, col, bindingsin, rowsin, is64bit, row_tree, "Col[%d]", col); + } + } + return offset; +@@ -5557,11 +5470,11 @@ static int dissect_CPMConnect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *par + + offset = parse_padding(tvb, offset, 8, pad_tree, "_paddingcPropSets"); + +- offset = parse_PropertySetArray(tvb, offset, blob_size1_off, tree, pad_tree, "PropSets"); ++ offset = parse_PropertySetArray(tvb, pinfo, offset, blob_size1_off, tree, pad_tree, "PropSets"); + + offset = parse_padding(tvb, offset, 8, pad_tree, "paddingExtPropset"); + +- offset = parse_PropertySetArray(tvb, offset, blob_size2_off, tree, pad_tree, "ExtPropset"); ++ offset = parse_PropertySetArray(tvb, pinfo, offset, blob_size2_off, tree, pad_tree, "ExtPropset"); + + offset = parse_padding(tvb, offset, 8, pad_tree, "???"); + +@@ -5616,7 +5529,7 @@ static int dissect_CPMCreateQuery(tvbuff_t *tvb, packet_info *pinfo, proto_tree + offset += 1; + + if (CRestrictionPresent) { +- offset = parse_CRestrictionArray(tvb, offset, tree, pad_tree, "RestrictionArray"); ++ offset = parse_CRestrictionArray(tvb, pinfo, offset, tree, pad_tree, "RestrictionArray"); + } + + CSortSetPresent = tvb_get_guint8(tvb, offset); +@@ -5625,7 +5538,7 @@ static int dissect_CPMCreateQuery(tvbuff_t *tvb, packet_info *pinfo, proto_tree + + if (CSortSetPresent) { + offset = parse_padding(tvb, offset, 4, tree, "paddingCSortSetPresent"); +- offset = parse_CInGroupSortAggregSets(tvb, offset, tree, pad_tree, "GroupSortAggregSets"); ++ offset = parse_CInGroupSortAggregSets(tvb, pinfo, offset, tree, pad_tree, "GroupSortAggregSets"); + + } + +@@ -5641,7 +5554,7 @@ static int dissect_CPMCreateQuery(tvbuff_t *tvb, packet_info *pinfo, proto_tree + proto_tree_add_uint(tree, hf_mswsp_msg_cpmcreatequery_ccateg_count, tvb, offset, 4, count); + offset += 4; + for (i=0; icbreserved, pad_tree, + "paddingRows"); +- parse_RowsBuffer(tvb, offset, num_rows, bindingsin, rowsin, b_64bit_mode, tree, "Rows"); ++ parse_RowsBuffer(tvb, pinfo, offset, num_rows, bindingsin, rowsin, b_64bit_mode, tree, "Rows"); + } else { + gint nbytes = tvb_reported_length_remaining(tvb, offset); + proto_tree_add_expert_format(tree, pinfo, &ei_missing_msg_context, tvb, offset, nbytes, "Undissected %d bytes (due to missing preceding msg(s))", nbytes); +@@ -5950,7 +5863,7 @@ static int dissect_CPMSetBindings(tvbuff_t *tvb, packet_info *pinfo, proto_tree + sizeof(struct CTableColumn) * num); + for (n=0; n ++#include + #include "packet-lbm.h" + + /* Magic number for message header to check if data is big-endian or little-endian. */ +@@ -837,7 +838,6 @@ static int dissect_segment_ofstable(tvbuff_t * tvb, int offset, packet_info * pi + proto_tree * subtree = NULL; + int datalen = 0; + int seglen = 0; +- int datalen_remaining = 0; + int ofs = 0; + int field_count = 0; + int idx; +@@ -862,9 +862,8 @@ static int dissect_segment_ofstable(tvbuff_t * tvb, int offset, packet_info * pi + id_list[idx] = -1; + ofs_list[idx] = -1; + } +- datalen_remaining = datalen; + ofs = offset + L_LBMPDM_SEG_HDR_T; +- for (idx = 0; (idx < field_count) && (datalen_remaining >= L_LBMPDM_OFFSET_ENTRY_T); idx++, ofs += L_LBMPDM_OFFSET_ENTRY_T) ++ for (idx = 0; idx < field_count; idx++, ofs += L_LBMPDM_OFFSET_ENTRY_T) + { + proto_item * offset_item = NULL; + proto_tree * offset_tree = NULL; +@@ -875,6 +874,9 @@ static int dissect_segment_ofstable(tvbuff_t * tvb, int offset, packet_info * pi + id_list[idx] = (gint32)lbmpdm_fetch_uint32_encoded(tvb, ofs + O_LBMPDM_OFFSET_ENTRY_T_ID, encoding); + proto_tree_add_item(offset_tree, hf_lbmpdm_offset_entry_offset, tvb, ofs + O_LBMPDM_OFFSET_ENTRY_T_OFFSET, L_LBMPDM_OFFSET_ENTRY_T_OFFSET, encoding); + ofs_list[idx] = (gint32)lbmpdm_fetch_uint32_encoded(tvb, ofs + O_LBMPDM_OFFSET_ENTRY_T_OFFSET, encoding); ++ if (id_list[idx] < 0 || ofs_list[idx] < 0) { ++ THROW(ReportedBoundsError); ++ } + if (id_list[idx] > max_index) + { + max_index = id_list[idx]; diff --git a/wireshark-0018-CVE-19624.patch b/wireshark-0018-CVE-19624.patch new file mode 100644 index 0000000..142bc45 --- /dev/null +++ b/wireshark-0018-CVE-19624.patch @@ -0,0 +1,17 @@ +diff --git a/epan/dissectors/packet-pvfs2.c b/epan/dissectors/packet-pvfs2.c +index e2b61bef7a..1c1012ceca 100644 +--- a/epan/dissectors/packet-pvfs2.c ++++ b/epan/dissectors/packet-pvfs2.c +@@ -2314,6 +2314,12 @@ dissect_pvfs2_getconfig_response(tvbuff_t *tvb, proto_tree *parent_tree, + /* Get pointer to server config data */ + ptr = tvb_get_ptr(tvb, offset, total_config_bytes); + ++ if (!ptr) ++ { ++ /* Not enough data. Bail out. */ ++ return offset; ++ } ++ + /* Check if all data is available */ + length_remaining = tvb_captured_length_remaining(tvb, offset); + diff --git a/wireshark-0019-CVE-19625.patch b/wireshark-0019-CVE-19625.patch new file mode 100644 index 0000000..6863af0 --- /dev/null +++ b/wireshark-0019-CVE-19625.patch @@ -0,0 +1,19 @@ +diff --git a/epan/tvbuff_composite.c b/epan/tvbuff_composite.c +index 5832477f81..e5ab7c8b17 100644 +--- a/epan/tvbuff_composite.c ++++ b/epan/tvbuff_composite.c +@@ -51,12 +51,9 @@ composite_free(tvbuff_t *tvb) + } + + static guint +-composite_offset(const tvbuff_t *tvb, const guint counter) ++composite_offset(const tvbuff_t *tvb _U_, const guint counter) + { +- const struct tvb_composite *composite_tvb = (const struct tvb_composite *) tvb; +- const tvbuff_t *member = (const tvbuff_t *)composite_tvb->composite.tvbs->data; +- +- return tvb_offset_from_real_beginning_counter(member, counter); ++ return counter; + } + + static const guint8* diff --git a/wireshark-0020-CVE-19626.patch b/wireshark-0020-CVE-19626.patch new file mode 100644 index 0000000..702c043 --- /dev/null +++ b/wireshark-0020-CVE-19626.patch @@ -0,0 +1,16 @@ +diff --git a/epan/dissectors/packet-dcom.c b/epan/dissectors/packet-dcom.c +index d12216a767..79cf6a6009 100644 +--- a/epan/dissectors/packet-dcom.c ++++ b/epan/dissectors/packet-dcom.c +@@ -1725,8 +1725,10 @@ dissect_dcom_BSTR(tvbuff_t *tvb, gint offset, packet_info *pinfo, + offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, sub_tree, di, drep, + &u32ArraySize); + +- if ((guint32)offset + u32ArraySize*2 > G_MAXINT) ++ if ((guint32)offset + u32ArraySize*2 > G_MAXINT) { ++ pszStr[0] = 0; + return offset; ++ } + + realOffset = offset + u32ArraySize*2; + diff --git a/wireshark-0021-CVE-19627.patch b/wireshark-0021-CVE-19627.patch new file mode 100644 index 0000000..bc98127 --- /dev/null +++ b/wireshark-0021-CVE-19627.patch @@ -0,0 +1,17 @@ +diff --git a/wiretap/vwr.c b/wiretap/vwr.c +index 8725ba9c3c..173614ec34 100644 +--- a/wiretap/vwr.c ++++ b/wiretap/vwr.c +@@ -2155,9 +2155,10 @@ static gboolean vwr_read_s3_W_rec(vwr_t *vwr, wtap_rec *record, + end_time = e_time / NS_IN_US; /* convert to microseconds first */ + + /* extract the 32 LSBs of the signature timestamp field */ +- m_ptr = &(rec[stats_offset+8+12]); ++ int m_ptr_offset = stats_offset + 8 + 12; ++ m_ptr = rec + m_ptr_offset; + pay_off = 42; /* 24 (MAC) + 8 (SNAP) + IP */ +- sig_off = find_signature(m_ptr, rec_size - 20, pay_off, flow_id, flow_seq); ++ sig_off = find_signature(m_ptr, rec_size - m_ptr_offset, pay_off, flow_id, flow_seq); + if (m_ptr[sig_off] == 0xdd) + sig_ts = get_signature_ts(m_ptr, sig_off, rec_size - vVW510021_W_STATS_TRAILER_LEN); + else diff --git a/wireshark-0022-CVE-19628.patch b/wireshark-0022-CVE-19628.patch new file mode 100644 index 0000000..0e7303f --- /dev/null +++ b/wireshark-0022-CVE-19628.patch @@ -0,0 +1,17 @@ +diff --git a/epan/dissectors/packet-zbee-zcl-lighting.c b/epan/dissectors/packet-zbee-zcl-lighting.c +index 2f8d880447..4757c272ce 100644 +--- a/epan/dissectors/packet-zbee-zcl-lighting.c ++++ b/epan/dissectors/packet-zbee-zcl-lighting.c +@@ -876,7 +876,11 @@ decode_color_xy(gchar *s, guint16 value) + static void + decode_color_temperature(gchar *s, guint16 value) + { +- g_snprintf(s, ITEM_LABEL_LENGTH, "%d [Mired] (%d [K])", value, 1000000/value); ++ if (value == 0) { ++ g_snprintf(s, ITEM_LABEL_LENGTH, "%u [Mired]", value); ++ } else { ++ g_snprintf(s, ITEM_LABEL_LENGTH, "%u [Mired] (%u [K])", value, 1000000/value); ++ } + return; + } /*decode_power_conf_voltage*/ + diff --git a/wireshark-0023-desktop-file.patch b/wireshark-0023-desktop-file.patch new file mode 100644 index 0000000..f87fce7 --- /dev/null +++ b/wireshark-0023-desktop-file.patch @@ -0,0 +1,10 @@ +diff --git a/wireshark.desktop b/wireshark.desktop +index 9b7339b..cfc787a 100644 +--- a/wireshark.desktop ++++ b/wireshark.desktop +@@ -108,4 +108,4 @@ Terminal=false + MimeType=application/vnd.tcpdump.pcap;application/x-pcapng;application/x-snoop;application/x-iptrace;application/x-lanalyzer;application/x-nettl;application/x-radcom;application/x-etherpeek;application/x-visualnetworks;application/x-netinstobserver;application/x-5view;application/x-tektronix-rf5;application/x-micropross-mplog;application/x-apple-packetlogger;application/x-endace-erf;application/ipfix;application/x-ixia-vwr; + # Category entry according to: + # http://standards.freedesktop.org/menu-spec/1.0/ +-Categories=Application;Network;Monitor;Qt; ++Categories=Network;Monitor;Qt; diff --git a/wireshark-0024-covscan.patch b/wireshark-0024-covscan.patch new file mode 100644 index 0000000..1e470e0 --- /dev/null +++ b/wireshark-0024-covscan.patch @@ -0,0 +1,114 @@ +diff --git a/tshark.c b/tshark.c +index 00c28db781..e02b61b663 100644 +--- a/tshark.c ++++ b/tshark.c +@@ -1977,10 +1977,10 @@ real_main(int argc, char *argv[]) + /* Activate the export PDU tap */ + comment = g_strdup_printf("Dump of PDUs from %s", cf_name); + err = exp_pdu_open(&exp_pdu_tap_data, exp_fd, comment); ++ g_free(comment); + if (err != 0) { + cfile_dump_open_failure_message("TShark", exp_pdu_filename, err, + WTAP_FILE_TYPE_SUBTYPE_PCAPNG); +- g_free(comment); + exit_status = INVALID_EXPORT; + goto clean_exit; + } +diff --git a/ui/export_pdu_ui_utils.c b/ui/export_pdu_ui_utils.c +index a567a61991..c9e40b7a24 100644 +--- a/ui/export_pdu_ui_utils.c ++++ b/ui/export_pdu_ui_utils.c +@@ -43,8 +43,8 @@ exp_pdu_file_open(exp_pdu_t *exp_pdu_tap_data) + + comment = g_strdup_printf("Dump of PDUs from %s", cfile.filename); + err = exp_pdu_open(exp_pdu_tap_data, import_file_fd, comment); ++ g_free(comment); + if (err != 0) { +- g_free(comment); + cfile_dump_open_failure_alert_box(capfile_name ? capfile_name : "temporary file", + err, WTAP_FILE_TYPE_SUBTYPE_PCAPNG); + goto end; +diff --git a/ui/tap_export_pdu.c b/ui/tap_export_pdu.c +index 25232f0452..d3302a5aca 100644 +--- a/ui/tap_export_pdu.c ++++ b/ui/tap_export_pdu.c +@@ -82,7 +82,7 @@ export_pdu_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const + } + + int +-exp_pdu_open(exp_pdu_t *exp_pdu_tap_data, int fd, char *comment) ++exp_pdu_open(exp_pdu_t *exp_pdu_tap_data, int fd, const char *comment) + { + + int err; +@@ -103,7 +103,6 @@ exp_pdu_open(exp_pdu_t *exp_pdu_tap_data, int fd, char *comment) + + /* options */ + wtap_block_add_string_option(shb_hdr, OPT_COMMENT, comment, strlen(comment)); +- g_free(comment); + + /* + * UTF-8 string containing the name of the operating system used to create +diff --git a/ui/tap_export_pdu.h b/ui/tap_export_pdu.h +index ea5c4077e1..9ae2dea65f 100644 +--- a/ui/tap_export_pdu.h ++++ b/ui/tap_export_pdu.h +@@ -41,7 +41,7 @@ char *exp_pdu_pre_open(const char *tap_name, const char *filter, + * + * @return 0 on success or a wtap error code. + */ +-int exp_pdu_open(exp_pdu_t *data, int fd, char *comment); ++int exp_pdu_open(exp_pdu_t *data, int fd, const char *comment); + + /* Stops the PDUs export. */ + int exp_pdu_close(exp_pdu_t *exp_pdu_tap_data); +diff --git a/ui/cli/tap-wspstat.c b/ui/cli/tap-wspstat.c +index 22862cdaf8..fd6f3ad427 100644 +--- a/ui/cli/tap-wspstat.c ++++ b/ui/cli/tap-wspstat.c +@@ -252,9 +252,9 @@ wspstat_init(const char *opt_arg, void *userdata _U_) + /* error, we failed to attach to the tap. clean up */ + g_free(sp->pdu_stats); + g_free(sp->filter); +- g_free(sp); + g_hash_table_foreach( sp->hash, (GHFunc) wsp_free_hash_table, NULL ) ; + g_hash_table_destroy( sp->hash ); ++ g_free(sp); + fprintf(stderr, "tshark: Couldn't register wsp,stat tap: %s\n", + error_string->str); + g_string_free(error_string, TRUE); +diff --git a/epan/dissectors/packet-isobus-vt.c b/epan/dissectors/packet-isobus-vt.c +index 1f9fa98..79f1c1f 100644 +--- a/epan/dissectors/packet-isobus-vt.c ++++ b/epan/dissectors/packet-isobus-vt.c +@@ -1546,16 +1546,8 @@ dissect_vt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, enum vt_directio + } + else + { +- if(status == 0) +- { +- col_append_fstr(pinfo->cinfo, COL_INFO, "Status of Auxiliary Input %s was successfully changed to enabled", +- get_object_id_string(auxiliary_input_object_id)); +- } +- else +- { +- col_append_fstr(pinfo->cinfo, COL_INFO, "Status of Auxiliary Input %s was successfully changed to enabled", +- get_object_id_string(auxiliary_input_object_id)); +- } ++ col_append_fstr(pinfo->cinfo, COL_INFO, "Status of Auxiliary Input %s was successfully changed to enabled", ++ get_object_id_string(auxiliary_input_object_id)); + } + } + } +diff --git a/epan/dfilter/dfilter.c b/epan/dfilter/dfilter.c +index a975f84..3e440b3 100644 +--- a/epan/dfilter/dfilter.c ++++ b/epan/dfilter/dfilter.c +@@ -221,6 +221,7 @@ dfilter_compile(const gchar *text, dfilter_t **dfp, gchar **err_msg) + } + + if ( !( expanded_text = dfilter_macro_apply(text, err_msg) ) ) { ++ *dfp = NULL; + return FALSE; + } + diff --git a/wireshark-0025-drop-count.patch b/wireshark-0025-drop-count.patch new file mode 100644 index 0000000..8837817 --- /dev/null +++ b/wireshark-0025-drop-count.patch @@ -0,0 +1,33 @@ +diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c +index 7b398cf..91fd9b8 100644 +--- a/wiretap/pcapng.c ++++ b/wiretap/pcapng.c +@@ -3230,6 +3230,10 @@ pcapng_write_enhanced_packet_block(wtap_dumper *wdh, const wtap_rec *rec, + have_options = TRUE; + options_total_length = options_total_length + 8; + } ++ if (rec->presence_flags & WTAP_HAS_DROP_COUNT) { ++ have_options = TRUE; ++ options_total_length = options_total_length + 12; ++ } + if (have_options) { + /* End-of options tag */ + options_total_length += 4; +@@ -3353,6 +3357,17 @@ pcapng_write_enhanced_packet_block(wtap_dumper *wdh, const wtap_rec *rec, + wdh->bytes_dumped += 4; + pcapng_debug("pcapng_write_enhanced_packet_block: Wrote Options packet flags: %x", rec->rec_header.packet_header.pack_flags); + } ++ if (rec->presence_flags & WTAP_HAS_DROP_COUNT) { ++ option_hdr.type = OPT_EPB_DROPCOUNT; ++ option_hdr.value_length = 8; ++ if (!wtap_dump_file_write(wdh, &option_hdr, 4, err)) ++ return FALSE; ++ wdh->bytes_dumped += 4; ++ if (!wtap_dump_file_write(wdh, &rec->rec_header.packet_header.drop_count, 8, err)) ++ return FALSE; ++ wdh->bytes_dumped += 8; ++ pcapng_debug("pcapng_write_enhanced_packet_block: Wrote Options drop count: %" G_GINT64_MODIFIER "u", rec->rec_header.packet_header.drop_count); ++ } + /* Write end of options if we have options */ + if (have_options) { + if (!wtap_dump_file_write(wdh, &zero_pad, 4, err)) diff --git a/wireshark-0026-mptcp.patch b/wireshark-0026-mptcp.patch new file mode 100644 index 0000000..ebb0cbb --- /dev/null +++ b/wireshark-0026-mptcp.patch @@ -0,0 +1,875 @@ +diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c +index 36e8afb2a3..73f4a2647a 100644 +--- a/epan/dissectors/packet-tcp.c ++++ b/epan/dissectors/packet-tcp.c +@@ -285,7 +285,9 @@ static int hf_mptcp_analysis_subflows_stream_id = -1; + static int hf_mptcp_analysis_subflows = -1; + static int hf_mptcp_number_of_removed_addresses = -1; + static int hf_mptcp_related_mapping = -1; +-static int hf_mptcp_duplicated_data = -1; ++static int hf_mptcp_reinjection_of = -1; ++static int hf_mptcp_reinjected_in = -1; ++ + + static int hf_tcp_option_fast_open_cookie_request = -1; + static int hf_tcp_option_fast_open_cookie = -1; +@@ -1455,8 +1457,8 @@ mptcp_init_subflow(tcp_flow_t *flow) + + DISSECTOR_ASSERT(flow->mptcp_subflow == 0); + flow->mptcp_subflow = sf; +- sf->mappings = wmem_itree_new(wmem_file_scope()); +- sf->dsn_map = wmem_itree_new(wmem_file_scope()); ++ sf->ssn2dsn_mappings = wmem_itree_new(wmem_file_scope()); ++ sf->dsn2packet_map = wmem_itree_new(wmem_file_scope()); + } + + +@@ -2607,13 +2609,13 @@ guint64 rawdsn64low, guint64 rawdsn64high + mptcp_dsn2packet_mapping_t *packet = NULL; + proto_item *item = NULL; + +- results = wmem_itree_find_intervals(subflow->mappings, ++ results = wmem_itree_find_intervals(subflow->dsn2packet_map, + wmem_packet_scope(), + rawdsn64low, + rawdsn64high + ); + +- for(packet_it=wmem_list_head(results); ++ for(packet_it = wmem_list_head(results); + packet_it != NULL; + packet_it = wmem_list_frame_next(packet_it)) + { +@@ -2621,43 +2623,18 @@ guint64 rawdsn64low, guint64 rawdsn64high + packet = (mptcp_dsn2packet_mapping_t *) wmem_list_frame_data(packet_it); + DISSECTOR_ASSERT(packet); + +- item = proto_tree_add_uint(tree, hf_mptcp_duplicated_data, tvb, 0, 0, packet->frame); ++ if(pinfo->num > packet->frame) { ++ item = proto_tree_add_uint(tree, hf_mptcp_reinjection_of, tvb, 0, 0, packet->frame); ++ } ++ else { ++ item = proto_tree_add_uint(tree, hf_mptcp_reinjected_in, tvb, 0, 0, packet->frame); ++ } + PROTO_ITEM_SET_GENERATED(item); + } + + return packet; + } + +-/* Finds mappings that cover the sent data */ +-static mptcp_dss_mapping_t * +-mptcp_add_matching_dss_on_subflow(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, struct mptcp_subflow *subflow, +-guint32 relseq, guint32 seglen +-) +-{ +- wmem_list_t *results = NULL; +- wmem_list_frame_t *dss_it = NULL; +- mptcp_dss_mapping_t *mapping = NULL; +- proto_item *item = NULL; +- +- results = wmem_itree_find_intervals(subflow->mappings, +- wmem_packet_scope(), +- relseq, +- (seglen) ? relseq + seglen - 1 : relseq +- ); +- +- for(dss_it=wmem_list_head(results); +- dss_it!= NULL; +- dss_it= wmem_list_frame_next(dss_it)) +- { +- mapping = (mptcp_dss_mapping_t *) wmem_list_frame_data(dss_it); +- DISSECTOR_ASSERT(mapping); +- +- item = proto_tree_add_uint(tree, hf_mptcp_related_mapping, tvb, 0, 0, mapping->frame); +- PROTO_ITEM_SET_GENERATED(item); +- } +- +- return mapping; +-} + + /* Lookup mappings that describe the packet and then converts the tcp seq number + * into the MPTCP Data Sequence Number (DSN) +@@ -2698,13 +2675,29 @@ mptcp_analysis_dsn_lookup(packet_info *pinfo , tvbuff_t *tvb, + rawdsn = tcpd->fwd->mptcp_subflow->meta->base_dsn; + convert = DSN_CONV_NONE; + } ++ /* if it's a non-syn packet without data (just used to convey TCP options) ++ * then there would be no mappings */ ++ else if(relseq == 1 && tcph->th_seglen == 0) { ++ rawdsn = tcpd->fwd->mptcp_subflow->meta->base_dsn + 1; ++ convert = DSN_CONV_NONE; ++ } + else { +- /* display packets that conveyed the mappings covering the data range */ +- mapping = mptcp_add_matching_dss_on_subflow(pinfo, parent_tree, tvb, +- tcpd->fwd->mptcp_subflow, relseq, +- (tcph->th_have_seglen) ? tcph->th_seglen : 0 +- ); +- if(mapping == NULL) { ++ ++ wmem_list_frame_t *dss_it = NULL; ++ wmem_list_t *results = NULL; ++ guint32 ssn_low = relseq; ++ guint32 seglen = tcph->th_seglen; ++ ++ results = wmem_itree_find_intervals(tcpd->fwd->mptcp_subflow->ssn2dsn_mappings, ++ wmem_packet_scope(), ++ ssn_low, ++ (seglen) ? ssn_low + seglen - 1 : ssn_low ++ ); ++ dss_it = wmem_list_head(results); /* assume it's always ok */ ++ if(dss_it) { ++ mapping = (mptcp_dss_mapping_t *) wmem_list_frame_data(dss_it); ++ } ++ if(dss_it == NULL || mapping == NULL) { + expert_add_info(pinfo, parent_tree, &ei_mptcp_mapping_missing); + return; + } +@@ -2713,6 +2706,19 @@ mptcp_analysis_dsn_lookup(packet_info *pinfo , tvbuff_t *tvb, + } + + DISSECTOR_ASSERT(mapping); ++ if(seglen) { ++ /* Finds mappings that cover the sent data and adds them to the dissection tree */ ++ for(dss_it = wmem_list_head(results); ++ dss_it != NULL; ++ dss_it = wmem_list_frame_next(dss_it)) ++ { ++ mapping = (mptcp_dss_mapping_t *) wmem_list_frame_data(dss_it); ++ DISSECTOR_ASSERT(mapping); ++ ++ item = proto_tree_add_uint(parent_tree, hf_mptcp_related_mapping, tvb, 0, 0, mapping->frame); ++ PROTO_ITEM_SET_GENERATED(item); ++ } ++ } + + convert = (mapping->extended_dsn) ? DSN_CONV_NONE : DSN_CONV_32_TO_64; + DISSECTOR_ASSERT(mptcp_map_relssn_to_rawdsn(mapping, relseq, &rawdsn)); +@@ -2732,39 +2738,40 @@ mptcp_analysis_dsn_lookup(packet_info *pinfo , tvbuff_t *tvb, + proto_item_append_text(item, " (Relative)"); + } + +- /* register */ +- if (!PINFO_FD_VISITED(pinfo)) +- { +- mptcp_dsn2packet_mapping_t *packet; +- packet = wmem_new0(wmem_file_scope(), mptcp_dsn2packet_mapping_t); +- packet->frame = pinfo->fd->num; +- packet->subflow = tcpd; +- +- /* tcph->th_mptcp->mh_rawdsn64 */ +- if (tcph->th_have_seglen) { +- wmem_itree_insert(tcpd->fwd->mptcp_subflow->dsn_map, ++ /* register dsn->packet mapping */ ++ if(mptcp_intersubflows_retransmission ++ && !PINFO_FD_VISITED(pinfo) ++ && tcph->th_seglen > 0 ++ ) { ++ mptcp_dsn2packet_mapping_t *packet = 0; ++ packet = wmem_new0(wmem_file_scope(), mptcp_dsn2packet_mapping_t); ++ packet->frame = pinfo->fd->num; ++ packet->subflow = tcpd; ++ ++ wmem_itree_insert(tcpd->fwd->mptcp_subflow->dsn2packet_map, + tcph->th_mptcp->mh_rawdsn64, + tcph->th_mptcp->mh_rawdsn64 + (tcph->th_seglen - 1 ), + packet + ); +- } + } + PROTO_ITEM_SET_GENERATED(item); + + /* We can do this only if rawdsn64 is valid ! + if enabled, look for overlapping mappings on other subflows */ +- if(mptcp_intersubflows_retransmission) { ++ if(mptcp_intersubflows_retransmission ++ && tcph->th_have_seglen ++ && tcph->th_seglen) { + + wmem_list_frame_t *subflow_it = NULL; + +- /* results should be some kind of in case 2 DSS are needed to cover this packet */ ++ /* results should be some kind of list in case 2 DSS are needed to cover this packet */ + for(subflow_it = wmem_list_head(mptcpd->subflows); subflow_it != NULL; subflow_it = wmem_list_frame_next(subflow_it)) { + struct tcp_analysis *sf_tcpd = (struct tcp_analysis *)wmem_list_frame_data(subflow_it); + struct mptcp_subflow *sf = mptcp_select_subflow_from_meta(sf_tcpd, tcpd->fwd->mptcp_subflow->meta); + + /* for current subflow */ + if (sf == tcpd->fwd->mptcp_subflow) { +- /* skip, was done just before */ ++ /* skip, this is the current subflow */ + } + /* in case there were retransmissions on other subflows */ + else { +@@ -2776,7 +2783,7 @@ mptcp_analysis_dsn_lookup(packet_info *pinfo , tvbuff_t *tvb, + } + } + else { +- /* ignore and continue */ ++ /* could not get the rawdsn64, ignore and continue */ + } + + } +@@ -4590,7 +4597,6 @@ dissect_tcpopt_mptcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* + + if (!PINFO_FD_VISITED(pinfo)) + { +- + /* register SSN range described by the mapping into a subflow interval_tree */ + mptcp_dss_mapping_t *mapping = NULL; + mapping = wmem_new0(wmem_file_scope(), mptcp_dss_mapping_t); +@@ -4601,7 +4607,7 @@ dissect_tcpopt_mptcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* + mapping->ssn_low = mph->mh_dss_ssn; + mapping->ssn_high = mph->mh_dss_ssn + mph->mh_dss_length-1; + +- wmem_itree_insert(tcpd->fwd->mptcp_subflow->mappings, ++ wmem_itree_insert(tcpd->fwd->mptcp_subflow->ssn2dsn_mappings, + mph->mh_dss_ssn, + mapping->ssn_high, + mapping +@@ -7564,15 +7570,19 @@ proto_register_tcp(void) + "This frame has some of the MPTCP analysis shown", HFILL }}, + + { &hf_mptcp_related_mapping, +- { "Related mapping", "mptcp.related_mapping", FT_FRAMENUM , BASE_NONE, NULL, 0x0, +- "Packet in which mapping describing current packet was sent", HFILL }}, ++ { "Related mapping", "mptcp.related_mapping", FT_FRAMENUM , BASE_NONE, NULL, 0x0, ++ "Packet in which current packet DSS mapping was sent", HFILL }}, ++ ++ { &hf_mptcp_reinjection_of, ++ { "Reinjection of", "mptcp.reinjection_of", FT_FRAMENUM , BASE_NONE, NULL, 0x0, ++ "This is a retransmission of data sent on another subflow", HFILL }}, + +- { &hf_mptcp_duplicated_data, +- { "Was data duplicated", "mptcp.duplicated_dsn", FT_FRAMENUM , BASE_NONE, NULL, 0x0, ++ { &hf_mptcp_reinjected_in, ++ { "Data reinjected in", "mptcp.reinjected_in", FT_FRAMENUM , BASE_NONE, NULL, 0x0, + "This was retransmitted on another subflow", HFILL }}, + + { &hf_mptcp_analysis_subflows, +- { "TCP subflow stream id(s):", "mptcp.analysis.subflows", FT_NONE, BASE_NONE, NULL, 0x0, ++ { "TCP subflow stream id(s):", "mptcp.analysis.subflows", FT_NONE, BASE_NONE, NULL, 0x0, + "List all TCP connections mapped to this MPTCP connection", HFILL }}, + + { &hf_mptcp_stream, +@@ -7752,13 +7762,16 @@ proto_register_tcp(void) + &mptcp_relative_seq); + + prefs_register_bool_preference(mptcp_module, "analyze_mappings", +- "In depth analysis of Data Sequence Signal (DSS) mappings.", ++ "Deeper analysis of Data Sequence Signal (DSS)", ++ "Scales logarithmically with the number of packets" + "You need to capture the handshake for this to work." + "\"Map TCP subflows to their respective MPTCP connections\"", + &mptcp_analyze_mappings); + + prefs_register_bool_preference(mptcp_module, "intersubflows_retransmission", + "Check for data duplication across subflows", ++ "(Greedy algorithm: Scales linearly with number of subflows and" ++ " logarithmic scaling with number of packets)" + "You need to enable DSS mapping analysis for this option to work", + &mptcp_intersubflows_retransmission); + +diff --git a/epan/dissectors/packet-tcp.h b/epan/dissectors/packet-tcp.h +index 7f84351ade..c1811fa049 100644 +--- a/epan/dissectors/packet-tcp.h ++++ b/epan/dissectors/packet-tcp.h +@@ -257,15 +257,16 @@ struct mptcp_subflow { + guint8 address_id; /* sent during an MP_JOIN */ + + +- /* Attempt to map DSN to packets +- * Ideally this was to generate application latency +- * each node contains a GSList * ? +- * this should be done in tap or 3rd party tools ++ /* map DSN to packets ++ * Used when looking for reinjections across subflows + */ +- wmem_itree_t *dsn_map; ++ wmem_itree_t *dsn2packet_map; + +- /* Map SSN to a DSS mappings, each node registers a mptcp_dss_mapping_t */ +- wmem_itree_t *mappings; ++ /* Map SSN to a DSS mappings ++ * a DSS can map DSN to SSNs possibily over several packets, ++ * hence some packets may have been mapped by previous DSS, ++ * whence the necessity to be able to look for SSN -> DSN */ ++ wmem_itree_t *ssn2dsn_mappings; + /* meta flow to which it is attached. Helps setting forward and backward meta flow */ + mptcp_meta_flow_t *meta; + }; +diff --git a/epan/wmem/wmem_interval_tree.c b/epan/wmem/wmem_interval_tree.c +index d52267de18..48888996b7 100644 +--- a/epan/wmem/wmem_interval_tree.c ++++ b/epan/wmem/wmem_interval_tree.c +@@ -121,7 +121,7 @@ wmem_itree_insert(wmem_itree_t *tree, const guint64 low, const guint64 high, voi + node = wmem_tree_insert(tree, range, data, (compare_func)wmem_tree_compare_ranges); + + /* Even If no rotations, still a need to update max_edge */ +- update_max_edge(node); ++ update_max_edge(node->parent); + } + + +diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c +index 74e9b6b10c..efcfa005af 100644 +--- a/epan/dissectors/packet-tcp.c ++++ b/epan/dissectors/packet-tcp.c +@@ -4361,6 +4361,35 @@ get_or_create_mptcpd_from_key(struct tcp_analysis* tcpd, tcp_flow_t *fwd, guint6 + return mptcpd; + } + ++/* record this mapping */ ++static ++void analyze_mapping(struct tcp_analysis *tcpd, packet_info *pinfo, guint16 len, guint64 dsn, gboolean extended, guint32 ssn) { ++ ++ /* store mapping only if analysis is enabled and mapping is not unlimited */ ++ if (!mptcp_analyze_mappings || !len) { ++ return; ++ } ++ ++ if (PINFO_FD_VISITED(pinfo)) { ++ return; ++ } ++ ++ /* register SSN range described by the mapping into a subflow interval_tree */ ++ mptcp_dss_mapping_t *mapping = NULL; ++ mapping = wmem_new0(wmem_file_scope(), mptcp_dss_mapping_t); ++ ++ mapping->rawdsn = dsn; ++ mapping->extended_dsn = extended; ++ mapping->frame = pinfo->fd->num; ++ mapping->ssn_low = ssn; ++ mapping->ssn_high = ssn + len - 1; ++ ++ wmem_itree_insert(tcpd->fwd->mptcp_subflow->ssn2dsn_mappings, ++ mapping->ssn_low, ++ mapping->ssn_high, ++ mapping ++ ); ++} + + /* + * The TCP Extensions for Multipath Operation with Multiple Addresses +@@ -4449,8 +4478,11 @@ dissect_tcpopt_mptcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* + } + offset += 1; + +- /* optlen == 12 => SYN or SYN/ACK; optlen == 20 => ACK */ +- if (optlen == 12 || optlen == 20) { ++ /* optlen == 12 => SYN or SYN/ACK; optlen == 20 => ACK; ++ * optlen == 22 => ACK + data (v1 only); ++ * optlen == 24 => ACK + data + csum (v1 only) ++ */ ++ if (optlen == 12 || optlen == 20 || optlen == 22 || optlen == 24) { + + mph->mh_key = tvb_get_ntoh64(tvb,offset); + proto_tree_add_uint64(mptcp_tree, hf_tcp_option_mptcp_sender_key, tvb, offset, 8, mph->mh_key); +@@ -4468,9 +4500,10 @@ dissect_tcpopt_mptcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* + PROTO_ITEM_SET_GENERATED(item); + + /* last ACK of 3WHS, repeats both keys */ +- if (optlen == 20) { ++ if (optlen >= 20) { + guint64 recv_key = tvb_get_ntoh64(tvb,offset); + proto_tree_add_uint64(mptcp_tree, hf_tcp_option_mptcp_recv_key, tvb, offset, 8, recv_key); ++ offset += 8; + + if(tcpd->rev->mptcp_subflow->meta + && (tcpd->rev->mptcp_subflow->meta->static_flags & MPTCP_META_HAS_KEY)) { +@@ -4484,6 +4517,26 @@ dissect_tcpopt_mptcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* + mptcpd = get_or_create_mptcpd_from_key(tcpd, tcpd->rev, recv_key, mph->mh_capable_flags & MPTCP_CAPABLE_CRYPTO_MASK); + } + } ++ ++ /* MPTCP v1 ACK + data, contains data_len and optional checksum */ ++ if (optlen >= 22) { ++ proto_tree_add_item(mptcp_tree, hf_tcp_option_mptcp_data_lvl_len, tvb, offset, 2, ENC_BIG_ENDIAN); ++ mph->mh_dss_length = tvb_get_ntohs(tvb,offset); ++ offset += 2; ++ ++ if (mph->mh_dss_length == 0) { ++ expert_add_info(pinfo, mptcp_tree, &ei_mptcp_infinite_mapping); ++ } ++ ++ /* when data len is present, this MP_CAPABLE also carries an implicit mapping ... */ ++ analyze_mapping(tcpd, pinfo, mph->mh_dss_length, tcpd->fwd->mptcp_subflow->meta->base_dsn + 1, TRUE, tcph->th_seq); ++ ++ /* ... with optional checksum */ ++ if (optlen == 24) ++ { ++ proto_tree_add_checksum(mptcp_tree, tvb, offset, hf_tcp_option_mptcp_checksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS); ++ } ++ } + } + break; + +@@ -4650,29 +4703,7 @@ dissect_tcpopt_mptcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* + /* ignore and continue */ + } + +- /* if mapping analysis enabled and not a */ +- if(mptcp_analyze_mappings && mph->mh_dss_length) +- { +- +- if (!PINFO_FD_VISITED(pinfo)) +- { +- /* register SSN range described by the mapping into a subflow interval_tree */ +- mptcp_dss_mapping_t *mapping = NULL; +- mapping = wmem_new0(wmem_file_scope(), mptcp_dss_mapping_t); +- +- mapping->rawdsn = mph->mh_dss_rawdsn; +- mapping->extended_dsn = (mph->mh_dss_flags & MPTCP_DSS_FLAG_DATA_ACK_8BYTES); +- mapping->frame = pinfo->fd->num; +- mapping->ssn_low = mph->mh_dss_ssn; +- mapping->ssn_high = mph->mh_dss_ssn + mph->mh_dss_length-1; +- +- wmem_itree_insert(tcpd->fwd->mptcp_subflow->ssn2dsn_mappings, +- mph->mh_dss_ssn, +- mapping->ssn_high, +- mapping +- ); +- } +- } ++ analyze_mapping(tcpd, pinfo, mph->mh_dss_length, mph->mh_dss_rawdsn, mph->mh_dss_flags & MPTCP_DSS_FLAG_DATA_ACK_8BYTES, mph->mh_dss_ssn); + + if ((int)optlen >= offset-start_offset+4) + { +diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c +index efcfa005af..238b592927 100644 +--- a/epan/dissectors/packet-tcp.c ++++ b/epan/dissectors/packet-tcp.c +@@ -246,7 +246,8 @@ static int hf_tcp_option_mptcp_flags = -1; + static int hf_tcp_option_mptcp_backup_flag = -1; + static int hf_tcp_option_mptcp_checksum_flag = -1; + static int hf_tcp_option_mptcp_B_flag = -1; +-static int hf_tcp_option_mptcp_H_flag = -1; ++static int hf_tcp_option_mptcp_H_v0_flag = -1; ++static int hf_tcp_option_mptcp_H_v1_flag = -1; + static int hf_tcp_option_mptcp_F_flag = -1; + static int hf_tcp_option_mptcp_m_flag = -1; + static int hf_tcp_option_mptcp_M_flag = -1; +@@ -593,10 +594,18 @@ static guint32 mptcp_stream_count; + */ + static wmem_tree_t *mptcp_tokens = NULL; + +-static const int *tcp_option_mptcp_capable_flags[] = { ++static const int *tcp_option_mptcp_capable_v0_flags[] = { + &hf_tcp_option_mptcp_checksum_flag, + &hf_tcp_option_mptcp_B_flag, +- &hf_tcp_option_mptcp_H_flag, ++ &hf_tcp_option_mptcp_H_v0_flag, ++ &hf_tcp_option_mptcp_reserved_flag, ++ NULL ++}; ++ ++static const int *tcp_option_mptcp_capable_v1_flags[] = { ++ &hf_tcp_option_mptcp_checksum_flag, ++ &hf_tcp_option_mptcp_B_flag, ++ &hf_tcp_option_mptcp_H_v1_flag, + &hf_tcp_option_mptcp_reserved_flag, + NULL + }; +@@ -2574,6 +2583,24 @@ mptcp_cryptodata_sha1(const guint64 key, guint32 *token, guint64 *idsn) + *idsn = GUINT64_FROM_BE(_isdn); + } + ++/* Generate the initial data sequence number and MPTCP connection token from the key. */ ++static void ++mptcp_cryptodata_sha256(const guint64 key, guint32 *token, guint64 *idsn) ++{ ++ guint8 digest_buf[HASH_SHA2_256_LENGTH]; ++ guint64 pseudokey = GUINT64_TO_BE(key); ++ guint32 _token; ++ guint64 _isdn; ++ ++ gcry_md_hash_buffer(GCRY_MD_SHA256, digest_buf, (const guint8 *)&pseudokey, 8); ++ ++ /* memcpy to prevent -Wstrict-aliasing errors with GCC 4 */ ++ memcpy(&_token, digest_buf, sizeof(_token)); ++ *token = GUINT32_FROM_BE(_token); ++ memcpy(&_isdn, digest_buf + HASH_SHA2_256_LENGTH - sizeof(_isdn), sizeof(_isdn)); ++ *idsn = GUINT64_FROM_BE(_isdn); ++} ++ + + /* Print formatted list of tcp stream ids that are part of the connection */ + static void +@@ -4338,7 +4365,7 @@ mptcp_get_meta_from_token(struct tcp_analysis* tcpd, tcp_flow_t *tcp_flow, guint + /* setup from_key */ + static + struct mptcp_analysis* +-get_or_create_mptcpd_from_key(struct tcp_analysis* tcpd, tcp_flow_t *fwd, guint64 key, guint8 hmac_algo _U_) { ++get_or_create_mptcpd_from_key(struct tcp_analysis* tcpd, tcp_flow_t *fwd, guint8 version, guint64 key, guint8 hmac_algo _U_) { + + guint32 token = 0; + guint64 expected_idsn= 0; +@@ -4348,8 +4375,11 @@ get_or_create_mptcpd_from_key(struct tcp_analysis* tcpd, tcp_flow_t *fwd, guint6 + return mptcpd; + } + +- /* MPTCP only standardizes SHA1 for now. */ +- mptcp_cryptodata_sha1(key, &token, &expected_idsn); ++ /* MPTCP v0 only standardizes SHA1, and v1 SHA256. */ ++ if (version == 0) ++ mptcp_cryptodata_sha1(key, &token, &expected_idsn); ++ else if (version == 1) ++ mptcp_cryptodata_sha256(key, &token, &expected_idsn); + + mptcpd = mptcp_get_meta_from_token(tcpd, fwd, token); + +@@ -4409,6 +4439,7 @@ dissect_tcpopt_mptcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* + proto_item *item,*main_item; + proto_tree *mptcp_tree; + ++ guint32 version; + guint8 subtype; + guint8 ipver; + int offset = 0; +@@ -4462,18 +4493,19 @@ dissect_tcpopt_mptcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* + case TCPOPT_MPTCP_MP_CAPABLE: + mph->mh_mpc = TRUE; + +- proto_tree_add_item(mptcp_tree, hf_tcp_option_mptcp_version, tvb, +- offset, 1, ENC_BIG_ENDIAN); ++ proto_tree_add_item_ret_uint(mptcp_tree, hf_tcp_option_mptcp_version, tvb, ++ offset, 1, ENC_BIG_ENDIAN, &version); + offset += 1; + + item = proto_tree_add_bitmask(mptcp_tree, tvb, offset, hf_tcp_option_mptcp_flags, +- ett_tcp_option_mptcp, tcp_option_mptcp_capable_flags, ++ ett_tcp_option_mptcp, ++ version == 1 ? tcp_option_mptcp_capable_v1_flags : tcp_option_mptcp_capable_v0_flags, + ENC_BIG_ENDIAN); + mph->mh_capable_flags = tvb_get_guint8(tvb, offset); + if ((mph->mh_capable_flags & MPTCP_CAPABLE_CRYPTO_MASK) == 0) { + expert_add_info(pinfo, item, &ei_mptcp_analysis_missing_algorithm); + } +- if ((mph->mh_capable_flags & MPTCP_CAPABLE_CRYPTO_MASK) != MPTCP_HMAC_SHA1) { ++ if ((mph->mh_capable_flags & MPTCP_CAPABLE_CRYPTO_MASK) != MPTCP_HMAC_SHA) { + expert_add_info(pinfo, item, &ei_mptcp_analysis_unsupported_algorithm); + } + offset += 1; +@@ -4488,7 +4520,7 @@ dissect_tcpopt_mptcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* + proto_tree_add_uint64(mptcp_tree, hf_tcp_option_mptcp_sender_key, tvb, offset, 8, mph->mh_key); + offset += 8; + +- mptcpd = get_or_create_mptcpd_from_key(tcpd, tcpd->fwd, mph->mh_key, mph->mh_capable_flags & MPTCP_CAPABLE_CRYPTO_MASK); ++ mptcpd = get_or_create_mptcpd_from_key(tcpd, tcpd->fwd, version, mph->mh_key, mph->mh_capable_flags & MPTCP_CAPABLE_CRYPTO_MASK); + mptcpd->master = tcpd; + + item = proto_tree_add_uint(mptcp_tree, +@@ -4514,7 +4546,7 @@ dissect_tcpopt_mptcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* + } + } + else { +- mptcpd = get_or_create_mptcpd_from_key(tcpd, tcpd->rev, recv_key, mph->mh_capable_flags & MPTCP_CAPABLE_CRYPTO_MASK); ++ mptcpd = get_or_create_mptcpd_from_key(tcpd, tcpd->rev, version, recv_key, mph->mh_capable_flags & MPTCP_CAPABLE_CRYPTO_MASK); + } + } + +@@ -7147,10 +7179,14 @@ proto_register_tcp(void) + { "Extensibility", "tcp.options.mptcp.extensibility.flag", FT_UINT8, + BASE_DEC, NULL, 0x40, NULL, HFILL}}, + +- { &hf_tcp_option_mptcp_H_flag, ++ { &hf_tcp_option_mptcp_H_v0_flag, + { "Use HMAC-SHA1", "tcp.options.mptcp.sha1.flag", FT_UINT8, + BASE_DEC, NULL, 0x01, NULL, HFILL}}, + ++ { &hf_tcp_option_mptcp_H_v1_flag, ++ { "Use HMAC-SHA256", "tcp.options.mptcp.sha256.flag", FT_UINT8, ++ BASE_DEC, NULL, 0x01, NULL, HFILL}}, ++ + { &hf_tcp_option_mptcp_F_flag, + { "DATA_FIN", "tcp.options.mptcp.datafin.flag", FT_UINT8, + BASE_DEC, NULL, MPTCP_DSS_FLAG_DATA_FIN_PRESENT, NULL, HFILL}}, +diff --git a/epan/dissectors/packet-tcp.h b/epan/dissectors/packet-tcp.h +index dfee9cdeb4..38630d3a51 100644 +--- a/epan/dissectors/packet-tcp.h ++++ b/epan/dissectors/packet-tcp.h +@@ -277,7 +277,8 @@ struct mptcp_subflow { + + typedef enum { + MPTCP_HMAC_NOT_SET = 0, +- MPTCP_HMAC_SHA1 = 1, ++ /* this is either SHA1 for MPTCP v0 or sha256 for MPTCP v1 */ ++ MPTCP_HMAC_SHA = 1, + MPTCP_HMAC_LAST + } mptcp_hmac_algorithm_t; + +diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c +index c4a9a6eb15..ca284604ed 100644 +--- a/epan/dissectors/packet-tcp.c ++++ b/epan/dissectors/packet-tcp.c +@@ -271,6 +271,7 @@ static int hf_tcp_option_mptcp_subflow_seq_no = -1; + static int hf_tcp_option_mptcp_data_lvl_len = -1; + static int hf_tcp_option_mptcp_checksum = -1; + static int hf_tcp_option_mptcp_ipver = -1; ++static int hf_tcp_option_mptcp_echo = -1; + static int hf_tcp_option_mptcp_ipv4 = -1; + static int hf_tcp_option_mptcp_ipv6 = -1; + static int hf_tcp_option_mptcp_port = -1; +@@ -4776,33 +4777,32 @@ dissect_tcpopt_mptcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* + break; + + case TCPOPT_MPTCP_ADD_ADDR: +- proto_tree_add_item(mptcp_tree, +- hf_tcp_option_mptcp_ipver, tvb, offset, 1, ENC_BIG_ENDIAN); + ipver = tvb_get_guint8(tvb, offset) & 0x0F; ++ if (ipver == 4 || ipver == 6) ++ proto_tree_add_item(mptcp_tree, ++ hf_tcp_option_mptcp_ipver, tvb, offset, 1, ENC_BIG_ENDIAN); ++ else ++ proto_tree_add_item(mptcp_tree, ++ hf_tcp_option_mptcp_echo, tvb, offset, 1, ENC_BIG_ENDIAN); + offset += 1; + + proto_tree_add_item(mptcp_tree, + hf_tcp_option_mptcp_address_id, tvb, offset, 1, ENC_BIG_ENDIAN); + offset += 1; + +- switch (ipver) { +- case 4: +- proto_tree_add_item(mptcp_tree, ++ if (optlen == 8 || optlen == 10 || optlen == 16 || optlen == 18) { ++ proto_tree_add_item(mptcp_tree, + hf_tcp_option_mptcp_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN); +- offset += 4; +- break; ++ offset += 4; ++ } + +- case 6: +- proto_tree_add_item(mptcp_tree, ++ if (optlen == 20 || optlen == 22 || optlen == 28 || optlen == 30) { ++ proto_tree_add_item(mptcp_tree, + hf_tcp_option_mptcp_ipv6, tvb, offset, 16, ENC_NA); +- offset += 16; +- break; +- +- default: +- break; ++ offset += 16; + } + +- if (optlen % 4 == 2) { ++ if (optlen == 10 || optlen == 18 || optlen == 22 || optlen == 30) { + proto_tree_add_item(mptcp_tree, + hf_tcp_option_mptcp_port, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; +@@ -7303,6 +7303,10 @@ proto_register_tcp(void) + { "IP version", "tcp.options.mptcp.ipver", FT_UINT8, + BASE_DEC, NULL, 0x0F, NULL, HFILL}}, + ++ { &hf_tcp_option_mptcp_echo, ++ { "Echo", "tcp.options.mptcp.echo", FT_UINT8, ++ BASE_DEC, NULL, 0x01, NULL, HFILL}}, ++ + { &hf_tcp_option_mptcp_ipv4, + { "Advertised IPv4 Address", "tcp.options.mptcp.ipv4", FT_IPv4, + BASE_NONE, NULL, 0x0, NULL, HFILL}}, +diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c +index 6bc1915e82..b0ed652215 100644 +--- a/epan/dissectors/packet-tcp.c ++++ b/epan/dissectors/packet-tcp.c +@@ -2152,13 +2152,19 @@ tcp_analyze_sequence_number(packet_info *pinfo, guint32 seq, guint32 ack, guint3 + && seq==tcpd->fwd->tcp_analyze_seq_info->nextseq + && ack==tcpd->fwd->tcp_analyze_seq_info->lastack + && (flags&(TH_SYN|TH_FIN|TH_RST))==0 ) { +- tcpd->fwd->tcp_analyze_seq_info->dupacknum++; +- if(!tcpd->ta) { +- tcp_analyze_get_acked_struct(pinfo->num, seq, ack, TRUE, tcpd); +- } +- tcpd->ta->flags|=TCP_A_DUPLICATE_ACK; +- tcpd->ta->dupack_num=tcpd->fwd->tcp_analyze_seq_info->dupacknum; +- tcpd->ta->dupack_frame=tcpd->fwd->tcp_analyze_seq_info->lastnondupack; ++ ++ /* MPTCP tolerates duplicate acks in some circumstances, see RFC 8684 4. */ ++ if(tcpd->mptcp_analysis && (tcpd->mptcp_analysis->mp_operations!=tcpd->fwd->mp_operations)) { ++ /* just ignore this DUPLICATE ACK */ ++ } else { ++ tcpd->fwd->tcp_analyze_seq_info->dupacknum++; ++ if(!tcpd->ta) { ++ tcp_analyze_get_acked_struct(pinfo->num, seq, ack, TRUE, tcpd); ++ } ++ tcpd->ta->flags|=TCP_A_DUPLICATE_ACK; ++ tcpd->ta->dupack_num=tcpd->fwd->tcp_analyze_seq_info->dupacknum; ++ tcpd->ta->dupack_frame=tcpd->fwd->tcp_analyze_seq_info->lastnondupack; ++ } + } + + +@@ -2343,6 +2349,10 @@ finished_checking_retransmission_type: + tcpd->fwd->tcp_analyze_seq_info->lastacktime.secs=pinfo->abs_ts.secs; + tcpd->fwd->tcp_analyze_seq_info->lastacktime.nsecs=pinfo->abs_ts.nsecs; + ++ /* remember the MPTCP operations if any */ ++ if( tcpd->mptcp_analysis ) { ++ tcpd->fwd->mp_operations=tcpd->mptcp_analysis->mp_operations; ++ } + + /* if there were any flags set for this segment we need to remember them + * we only remember the flags for the very last segment though. +@@ -2702,24 +2712,17 @@ mptcp_analysis_add_subflows(packet_info *pinfo _U_, tvbuff_t *tvb, + proto_tree *parent_tree, struct mptcp_analysis* mptcpd) + { + wmem_list_frame_t *it; +- proto_tree *tree; + proto_item *item; + +- item=proto_tree_add_item(parent_tree, hf_mptcp_analysis_subflows, tvb, 0, 0, ENC_NA); +- PROTO_ITEM_SET_GENERATED(item); +- +- tree=proto_item_add_subtree(item, ett_mptcp_analysis_subflows); ++ wmem_strbuf_t *val = wmem_strbuf_new(wmem_packet_scope(), ""); + + /* for the analysis, we set each subflow tcp stream id */ + for(it = wmem_list_head(mptcpd->subflows); it != NULL; it = wmem_list_frame_next(it)) { + struct tcp_analysis *sf = (struct tcp_analysis *)wmem_list_frame_data(it); +- proto_item *subflow_item; +- subflow_item=proto_tree_add_uint(tree, hf_mptcp_analysis_subflows_stream_id, tvb, 0, 0, sf->stream); +- PROTO_ITEM_SET_HIDDEN(subflow_item); +- +- proto_item_append_text(item, " %d", sf->stream); ++ wmem_strbuf_append_printf(val, "%u ", sf->stream); + } + ++ item = proto_tree_add_string(parent_tree, hf_mptcp_analysis_subflows, tvb, 0, 0, wmem_strbuf_get_str(val)); + PROTO_ITEM_SET_GENERATED(item); + } + +@@ -2962,6 +2965,42 @@ mptcp_add_analysis_subtree(packet_info *pinfo, tvbuff_t *tvb, proto_tree *parent + + PROTO_ITEM_SET_GENERATED(item); + ++ /* store the TCP Options related to MPTCP then we will avoid false DUP ACKs later */ ++ guint8 nbOptionsChanged = 0; ++ if((tcpd->mptcp_analysis->mp_operations&(0x01))!=tcph->th_mptcp->mh_mpc) { ++ tcpd->mptcp_analysis->mp_operations |= 0x01; ++ nbOptionsChanged++; ++ } ++ if((tcpd->mptcp_analysis->mp_operations&(0x02))!=tcph->th_mptcp->mh_join) { ++ tcpd->mptcp_analysis->mp_operations |= 0x02; ++ nbOptionsChanged++; ++ } ++ if((tcpd->mptcp_analysis->mp_operations&(0x04))!=tcph->th_mptcp->mh_dss) { ++ tcpd->mptcp_analysis->mp_operations |= 0x04; ++ nbOptionsChanged++; ++ } ++ if((tcpd->mptcp_analysis->mp_operations&(0x08))!=tcph->th_mptcp->mh_add) { ++ tcpd->mptcp_analysis->mp_operations |= 0x08; ++ nbOptionsChanged++; ++ } ++ if((tcpd->mptcp_analysis->mp_operations&(0x10))!=tcph->th_mptcp->mh_remove) { ++ tcpd->mptcp_analysis->mp_operations |= 0x10; ++ nbOptionsChanged++; ++ } ++ if((tcpd->mptcp_analysis->mp_operations&(0x20))!=tcph->th_mptcp->mh_prio) { ++ tcpd->mptcp_analysis->mp_operations |= 0x20; ++ nbOptionsChanged++; ++ } ++ if((tcpd->mptcp_analysis->mp_operations&(0x40))!=tcph->th_mptcp->mh_fail) { ++ tcpd->mptcp_analysis->mp_operations |= 0x40; ++ nbOptionsChanged++; ++ } ++ if((tcpd->mptcp_analysis->mp_operations&(0x80))!=tcph->th_mptcp->mh_fastclose) { ++ tcpd->mptcp_analysis->mp_operations |= 0x80; ++ nbOptionsChanged++; ++ } ++ /* we could track MPTCP option changes here, with nbOptionsChanged */ ++ + item = proto_tree_add_uint(tree, hf_mptcp_stream, tvb, 0, 0, mptcpd->stream); + PROTO_ITEM_SET_GENERATED(item); + +@@ -4537,6 +4576,7 @@ get_or_create_mptcpd_from_key(struct tcp_analysis* tcpd, tcp_flow_t *fwd, guint8 + + DISSECTOR_ASSERT(fwd->mptcp_subflow->meta); + ++ fwd->mptcp_subflow->meta->version = version; + fwd->mptcp_subflow->meta->key = key; + fwd->mptcp_subflow->meta->static_flags |= MPTCP_META_HAS_KEY; + fwd->mptcp_subflow->meta->base_dsn = expected_idsn; +@@ -4747,6 +4787,13 @@ dissect_tcpopt_mptcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* + offset += 4; + + mptcpd = mptcp_get_meta_from_token(tcpd, tcpd->rev, mph->mh_token); ++ if (tcpd->fwd->mptcp_subflow->meta->version == 1) { ++ mptcp_meta_flow_t *tmp = tcpd->fwd->mptcp_subflow->meta; ++ ++ /* if the negotiated version is v1 the first key was exchanged on SYN/ACK packet: we must swap the meta */ ++ tcpd->fwd->mptcp_subflow->meta = tcpd->rev->mptcp_subflow->meta; ++ tcpd->rev->mptcp_subflow->meta = tmp; ++ } + + proto_tree_add_item_ret_uint(mptcp_tree, hf_tcp_option_mptcp_sender_rand, tvb, offset, + 4, ENC_BIG_ENDIAN, &tcpd->fwd->mptcp_subflow->nonce); +@@ -4897,6 +4944,7 @@ dissect_tcpopt_mptcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* + break; + + case TCPOPT_MPTCP_ADD_ADDR: ++ mph->mh_add = TRUE; + ipver = tvb_get_guint8(tvb, offset) & 0x0F; + if (ipver == 4 || ipver == 6) + proto_tree_add_item(mptcp_tree, +@@ -4935,6 +4983,7 @@ dissect_tcpopt_mptcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* + break; + + case TCPOPT_MPTCP_REMOVE_ADDR: ++ mph->mh_remove = TRUE; + item = proto_tree_add_uint(mptcp_tree, hf_mptcp_number_of_removed_addresses, tvb, start_offset+2, + 1, optlen - 3); + PROTO_ITEM_SET_GENERATED(item); +@@ -4947,6 +4996,7 @@ dissect_tcpopt_mptcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* + break; + + case TCPOPT_MPTCP_MP_PRIO: ++ mph->mh_prio = TRUE; + proto_tree_add_bitmask(mptcp_tree, tvb, offset, hf_tcp_option_mptcp_flags, + ett_tcp_option_mptcp, tcp_option_mptcp_join_flags, + ENC_BIG_ENDIAN); +@@ -8040,7 +8090,7 @@ proto_register_tcp(void) + "This was retransmitted on another subflow", HFILL }}, + + { &hf_mptcp_analysis_subflows, +- { "TCP subflow stream id(s):", "mptcp.analysis.subflows", FT_NONE, BASE_NONE, NULL, 0x0, ++ { "TCP subflow stream id(s)", "mptcp.analysis.subflows", FT_STRING, BASE_NONE, NULL, 0x0, + "List all TCP connections mapped to this MPTCP connection", HFILL }}, + + { &hf_mptcp_stream, +diff --git a/epan/dissectors/packet-tcp.h b/epan/dissectors/packet-tcp.h +index ac250d948e..21e6a61086 100644 +--- a/epan/dissectors/packet-tcp.h ++++ b/epan/dissectors/packet-tcp.h +@@ -49,8 +49,11 @@ struct mptcpheader { + gboolean mh_mpc; /* true if seen an mp_capable option */ + gboolean mh_join; /* true if seen an mp_join option */ + gboolean mh_dss; /* true if seen a dss */ +- gboolean mh_fastclose; /* true if seen a fastclose */ ++ gboolean mh_add; /* true if seen an MP_ADD */ ++ gboolean mh_remove; /* true if seen an MP_REMOVE */ ++ gboolean mh_prio; /* true if seen an MP_PRIO */ + gboolean mh_fail; /* true if seen an MP_FAIL */ ++ gboolean mh_fastclose; /* true if seen a fastclose */ + + guint8 mh_capable_flags; /* to get hmac version for instance */ + guint8 mh_dss_flags; /* data sequence signal flag */ +@@ -332,6 +335,7 @@ typedef struct _tcp_flow_t { + gboolean valid_bif; /* if lost pkts, disable BiF until ACK is recvd */ + guint32 push_bytes_sent; /* bytes since the last PSH flag */ + gboolean push_set_last; /* tracking last time PSH flag was set */ ++ guint8 mp_operations; /* tracking of the MPTCP operations */ + + tcp_analyze_seq_flow_info_t* tcp_analyze_seq_info; + +@@ -378,6 +382,9 @@ struct mptcp_analysis { + + /* identifier of the tcp stream that saw the initial 3WHS with MP_CAPABLE option */ + struct tcp_analysis *master; ++ ++ /* Keep track of the last TCP operations seen in order to avoid false DUP ACKs */ ++ guint8 mp_operations; + }; + + struct tcp_analysis { diff --git a/wireshark-0027-ibm-smc.patch b/wireshark-0027-ibm-smc.patch new file mode 100644 index 0000000..2df4d08 --- /dev/null +++ b/wireshark-0027-ibm-smc.patch @@ -0,0 +1,1871 @@ +diff --git a/epan/dissectors/CMakeLists.txt b/epan/dissectors/CMakeLists.txt +index 11d2c89cd0..3c313d2c5e 100644 +--- a/epan/dissectors/CMakeLists.txt ++++ b/epan/dissectors/CMakeLists.txt +@@ -1745,7 +1745,7 @@ set(DISSECTOR_SRC + ${CMAKE_CURRENT_SOURCE_DIR}/packet-smb-direct.c + ${CMAKE_CURRENT_SOURCE_DIR}/packet-smb.c + ${CMAKE_CURRENT_SOURCE_DIR}/packet-smb2.c +- ${CMAKE_CURRENT_SOURCE_DIR}/packet-smcr.c ++ ${CMAKE_CURRENT_SOURCE_DIR}/packet-smc.c + ${CMAKE_CURRENT_SOURCE_DIR}/packet-sml.c + ${CMAKE_CURRENT_SOURCE_DIR}/packet-smp.c + ${CMAKE_CURRENT_SOURCE_DIR}/packet-smpp.c +diff --git a/epan/dissectors/packet-smcr.c b/epan/dissectors/packet-smc.c +similarity index 56% +rename from epan/dissectors/packet-smcr.c +rename to epan/dissectors/packet-smc.c +index 7096d1b0b0..bbfa9c07ef 100644 +--- a/epan/dissectors/packet-smcr.c ++++ b/epan/dissectors/packet-smc.c +@@ -1,7 +1,8 @@ +-/* packet-smcr.c +- * SMC-R dissector for wireshark ++/* packet-smc.c ++ * SMC dissector for wireshark + * By Joe Fowler +- * (c) Copyright IBM Corporation 2014 ++ * By Guvenc Gulce ++ * (c) Copyright IBM Corporation 2014,2020 + * LICENSE: GNU General Public License, version 2, or (at your option) any + * version. http://opensource.org/licenses/gpl-2.0.php + * +@@ -13,6 +14,7 @@ + * + * Please refer to the following specs for protocol: + * - ietf - draft-fox-tcpm-shared-memory-rdma-05 ++ * - https://www.ibm.com/support/pages/node/6326337 + */ + + #include "config.h" +@@ -20,25 +22,33 @@ + #include + + #include "packet-tcp.h" ++#include + +-#define SMCR_TCP_MIN_HEADER_LENGTH 7 +-#define CLC_MSG_START_OFFSET 7 ++#define SMC_TCP_MIN_HEADER_LENGTH 7 ++#define CLC_MSG_START_OFFSET 5 + #define LLC_MSG_START_OFFSET 3 + #define RMBE_CTRL_START_OFFSET 2 + #define MAC_ADDR_LEN 6 ++#define SMC_V2 2 + #define GID_LEN 16 + #define PEERID_LEN 8 ++#define DIAG_INFO_LEN 4 ++#define EID_LEN 32 ++#define ISM_GID_LEN 8 ++#define ISM_CHID_LEN 2 + #define IPV4_SUBNET_MASK_LEN 4 +-#define IPV6_PREFIX_LEN 4 ++#define IPV6_PREFIX_LEN 16 + #define ONE_BYTE_RESERVED 1 + #define TWO_BYTE_RESERVED 2 + #define QP_LEN 3 + #define RKEY_LEN 4 + #define VIRTUAL_ADDR_LEN 8 + #define FLAG_BYTE_LEN 1 ++#define LENGTH_BYTE_LEN 2 + #define SEQNO_LEN 2 + #define CURSOR_LEN 4 + #define ALERT_TOKEN_LEN 4 ++#define DMB_TOKEN_LEN 8 + #define PSN_LEN 3 + #define CONN_INDEX_LEN 1 + #define SMCR_MSG_BYTE_0 0 +@@ -52,6 +62,7 @@ + #define LLC_CMD_RSP_OFFSET 3 + #define ACCEPT_CONFIRM_QP_OFFSET 38 + #define SMCR_CLC_ID 0xe2d4c3d9 /*EBCDIC 'SMCR' */ ++#define SMCD_CLC_ID 0xe2d4c3c4 /*EBCDIC 'SMCD' */ + #define SMC_CLC_V1 0x10 + #define SMC_CLC_SMC_R 0x01 + +@@ -66,6 +77,52 @@ typedef enum { + SMC_CLC_DECLINE = 4 + } clc_message; + ++typedef enum { ++ SMC_CLC_SMCR = 0, ++ SMC_CLC_SMCD = 1, ++ SMC_CLC_NONE = 2, ++ SMC_CLC_BOTH = 3, ++} clc_type_message; ++ ++typedef enum { ++ SMC_CLC_OS_ZOS = 1, ++ SMC_CLC_OS_LINUX = 2, ++ SMC_CLC_OS_AIX = 3, ++ SMC_CLC_OS_UNKOWN = 15, ++} clc_os_message; ++ ++static const value_string smc_clc_os_message_txt[] = { ++ { SMC_CLC_OS_ZOS, "z/OS" }, ++ { SMC_CLC_OS_LINUX, "Linux" }, ++ { SMC_CLC_OS_AIX, "AIX" }, ++ { SMC_CLC_OS_UNKOWN, "Unknown" }, ++ { 0, NULL } ++}; ++ ++static const value_string smc_clc_type_message_txt[] = { ++ { SMC_CLC_SMCR, "SMC-R" }, ++ { SMC_CLC_SMCD, "SMC-D" }, ++ { SMC_CLC_NONE, "NONE" }, ++ { SMC_CLC_BOTH, "SMC-R/SMC-D" }, ++ { 0, NULL } ++}; ++ ++ ++static const value_string smcv2_clc_col_info_message_txt[] = { ++ { SMC_CLC_SMCR, "[SMC-R-Proposal]" }, ++ { SMC_CLC_SMCD, "[SMC-Dv2-Proposal]" }, ++ { SMC_CLC_NONE, "[NONE]" }, ++ { SMC_CLC_BOTH, "[SMC-Dv2/SMC-R-Proposal]" }, ++ { 0, NULL } ++}; ++ ++static const value_string smc_clc_col_info_message_txt[] = { ++ { SMC_CLC_SMCR, "[SMC-R-Proposal]" }, ++ { SMC_CLC_SMCD, "[SMC-D-Proposal]" }, ++ { SMC_CLC_NONE, "[NONE]" }, ++ { SMC_CLC_BOTH, "[SMC-D/SMC-R-Proposal]" }, ++ { 0, NULL } ++}; + + static const value_string smcr_clc_message_txt[] = { + { SMC_CLC_PROPOSAL, "Proposal" }, +@@ -104,22 +161,35 @@ static const value_string smcr_llc_message_txt[] = { + { 0, NULL } + }; + +-static int proto_smcr = -1; ++static int proto_smc = -1; + static int ett_smcr = -1; + static int hf_smcr_clc_msg = -1; + static int hf_smcr_llc_msg = -1; + +-/* SMC-R Proposal */ ++/* SMC Proposal for both SMC-D and SMC-R */ + static int ett_proposal_flag = -1; ++static int ett_proposal_ext_flag2 = -1; ++static int hf_proposal_smc_version_release_number = -1; ++static int hf_proposal_smc_version_seid = -1; + static int hf_proposal_smc_version = -1; +-static int hf_smcr_proposal_flags = -1; +-static int hf_smcr_proposal_client_peer_id = -1; +-static int hf_smcr_proposal_client_preferred_gid = -1; +-static int hf_smcr_proposal_client_preferred_mac = -1; +-static int hf_smcr_proposal_outgoing_interface_subnet_mask = -1; +-static int hf_smcr_proposal_outgoing_subnet_mask_signifcant_bits = -1; +-static int hf_smcr_proposal_ipv6_prefix = -1; +-static int hf_smcr_proposal_ipv6_prefix_length = -1; ++static int hf_proposal_smc_type = -1; ++static int hf_proposal_smc_v2_type = -1; ++static int hf_smc_length = -1; ++static int hf_smc_proposal_smc_chid = -1; ++static int hf_smc_proposal_flags = -1; ++static int hf_smc_proposal_eid = -1; ++static int hf_smc_proposal_system_eid = -1; ++static int hf_smc_proposal_ext_flags = -1; ++static int hf_smc_proposal_client_peer_id = -1; ++static int hf_smc_proposal_ism_gid = -1; ++static int hf_smc_proposal_client_preferred_gid = -1; ++static int hf_smc_proposal_client_preferred_mac = -1; ++static int hf_smc_proposal_outgoing_interface_subnet_mask = -1; ++static int hf_smc_proposal_rocev2_gid_ipv4_addr = -1; ++static int hf_smc_proposal_rocev2_gid_ipv6_addr = -1; ++static int hf_smc_proposal_outgoing_subnet_mask_signifcant_bits = -1; ++static int hf_smc_proposal_ipv6_prefix = -1; ++static int hf_smc_proposal_ipv6_prefix_length = -1; + + /* SMC-R Accept */ + static int ett_accept_flag = -1; +@@ -158,10 +228,57 @@ static int hf_confirm_smc_version = -1; + static int hf_confirm_rmb_buffer_size = -1; + static int hf_confirm_qp_mtu_value = -1; + ++/* SMC-D Accept */ ++static int hf_accept_smc_type = -1; ++static int ett_smcd_accept_flag = -1; ++static int ett_smcd_accept_fce_flag = -1; ++static int ett_smcd_accept_flag2 = -1; ++static int hf_smcd_accept_smc_version = -1; ++static int hf_accept_os_type = -1; ++static int hf_accept_smc_version_release_number = -1; ++static int hf_smcd_accept_first_contact = -1; ++static int hf_accept_dmb_buffer_size = -1; ++static int hf_smcd_accept_flags = -1; ++static int hf_smcd_accept_fce_flags = -1; ++static int hf_smcd_accept_flags2 = -1; ++static int hf_smcd_accept_server_peer_id = -1; ++static int hf_smcd_accept_dmbe_conn_index = -1; ++static int hf_smcd_accept_dmb_token = -1; ++static int hf_smcd_accept_server_link_id = -1; ++static int hf_smcd_accept_smc_chid = -1; ++static int hf_smcd_accept_eid = -1; ++static int hf_smcd_accept_peer_name = -1; ++ ++/* SMC-D Confirm */ ++static int hf_confirm_smc_type = -1; ++static int ett_smcd_confirm_flag = -1; ++static int ett_smcd_confirm_fce_flag = -1; ++static int ett_smcd_confirm_flag2 = -1; ++static int hf_smcd_confirm_smc_version = -1; ++static int hf_confirm_os_type = -1; ++static int hf_smcd_confirm_flags = -1; ++static int hf_smcd_confirm_flags2 = -1; ++static int hf_smcd_confirm_first_contact = -1; ++static int hf_smcd_confirm_client_peer_id = -1; ++static int hf_smcd_confirm_dmb_token = -1; ++static int hf_smcd_confirm_dmbe_conn_index = -1; ++static int hf_smcd_confirm_client_link_id = -1; ++static int hf_confirm_smc_version_release_number = -1; ++static int hf_smcd_confirm_dmb_buffer_size = -1; ++static int hf_smcd_confirm_smc_chid = -1; ++static int hf_smcd_confirm_eid = -1; ++static int hf_smcd_confirm_peer_name = -1; ++ + /* SMC-R Decline */ +-static int hf_smcr_decline_flags = -1; +-static int hf_smcr_decline_peer_id = -1; +-static int hf_smcr_decline_diag_info = -1; ++static int ett_decline_flag = -1; ++static int ett_decline_flag2 = -1; ++static int hf_smc_decline_flags = -1; ++static int hf_smc_decline_flags2 = -1; ++static int hf_smc_decline_peer_id = -1; ++static int hf_smc_decline_diag_info = -1; ++static int hf_decline_os_type = -1; ++static int hf_decline_smc_version = -1; ++static int hf_decline_out_of_sync = -1; + + /* SMC-R Confirm Link*/ + static int ett_confirm_link_flag = -1; +@@ -256,55 +373,300 @@ static int hf_smcr_rmbe_ctrl_peer_abnormal_close = -1; + + void proto_register_smcr(void); + void proto_reg_handoff_smcr(void); +-static dissector_handle_t smcr_tcp_handle; ++static dissector_handle_t smc_tcp_handle; + + static void +-disect_smcr_proposal(tvbuff_t *tvb, proto_tree *tree) ++disect_smc_proposal(tvbuff_t *tvb, proto_tree *tree, bool is_ipv6) + { +- guint offset; +- guint16 mask_offset; +- guint8 ipv6_prefix_count; ++ guint offset, suboffset; ++ guint16 mask_offset, v2_ext_offset; ++ guint16 v2_ext_pos = 0, smcd_v2_ext_offset = 0; ++ guint16 smcd_v2_ext_pos = 0; ++ guint8 ipv6_prefix_count, smc_version; ++ guint8 smc_type, num_of_gids = 0, num_of_eids = 0; ++ guint8 smc_type_v1 = 0, smc_type_v2 = 0; ++ bool is_smc_v2, is_smcdv1, is_smcdv2; + proto_item *proposal_flag_item; + proto_tree *proposal_flag_tree; + ++ + offset = CLC_MSG_START_OFFSET; +- proposal_flag_item = proto_tree_add_item(tree, hf_smcr_proposal_flags, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ proto_tree_add_item(tree, hf_smc_length, tvb, offset, ++ LENGTH_BYTE_LEN, ENC_BIG_ENDIAN); ++ offset += LENGTH_BYTE_LEN; ++ proposal_flag_item = proto_tree_add_item(tree, hf_smc_proposal_flags, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); + proposal_flag_tree = proto_item_add_subtree(proposal_flag_item, ett_proposal_flag); + proto_tree_add_item(proposal_flag_tree, hf_proposal_smc_version, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ smc_version = tvb_get_guint8(tvb, offset); ++ smc_type = tvb_get_guint8(tvb, offset); ++ smc_version = ((smc_version >> 4) & 0x0F); ++ is_smc_v2 = (smc_version >= SMC_V2); ++ smc_type_v2 = ((smc_type >> 2) & 0x03); ++ smc_type_v1 = (smc_type & 0x03); ++ is_smcdv1 = ((smc_type_v1 == SMC_CLC_SMCD) || (smc_type_v1 == SMC_CLC_BOTH)); ++ is_smcdv2 = ((smc_type_v2 == SMC_CLC_SMCD) || (smc_type_v2 == SMC_CLC_BOTH)); ++ ++ if (is_smc_v2) ++ proto_tree_add_item(proposal_flag_tree, hf_proposal_smc_v2_type, tvb, ++ offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ ++ proto_tree_add_item(proposal_flag_tree, hf_proposal_smc_type, tvb, ++ offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ + offset += FLAG_BYTE_LEN; +- proto_tree_add_item(tree, hf_smcr_proposal_client_peer_id, tvb, offset, ++ proto_tree_add_item(tree, hf_smc_proposal_client_peer_id, tvb, offset, + PEERID_LEN, ENC_BIG_ENDIAN); + offset += PEERID_LEN; +- proto_tree_add_item(tree, hf_smcr_proposal_client_preferred_gid, tvb, ++ proto_tree_add_item(tree, hf_smc_proposal_client_preferred_gid, tvb, + offset, GID_LEN, ENC_NA); + offset += GID_LEN; +- proto_tree_add_item(tree, hf_smcr_proposal_client_preferred_mac, tvb, ++ proto_tree_add_item(tree, hf_smc_proposal_client_preferred_mac, tvb, + offset, MAC_ADDR_LEN, ENC_NA); + offset += MAC_ADDR_LEN; + mask_offset = tvb_get_ntohs(tvb, offset); +- offset += 2 + mask_offset; +- proto_tree_add_item(tree, hf_smcr_proposal_outgoing_interface_subnet_mask, tvb, +- offset, IPV4_SUBNET_MASK_LEN, ENC_BIG_ENDIAN); ++ ++ if (mask_offset != 0) { ++ suboffset = offset; ++ suboffset += TWO_BYTE_RESERVED; ++ if (is_smcdv1 || is_smcdv2) { ++ proto_tree_add_item(tree, hf_smc_proposal_ism_gid, tvb, ++ suboffset, ISM_GID_LEN, ENC_NA); ++ } ++ suboffset += ISM_GID_LEN; ++ if (is_smc_v2) { ++ if (is_smcdv2) { ++ proto_tree_add_item(tree, hf_smc_proposal_smc_chid, tvb, suboffset, ++ LENGTH_BYTE_LEN, ENC_BIG_ENDIAN); ++ } ++ suboffset += LENGTH_BYTE_LEN; ++ v2_ext_offset = tvb_get_ntohs(tvb, suboffset); ++ v2_ext_pos = suboffset + TWO_BYTE_RESERVED + v2_ext_offset; ++ } ++ } ++ offset += TWO_BYTE_RESERVED + mask_offset; ++ ++ proto_tree_add_item(tree, hf_smc_proposal_outgoing_interface_subnet_mask, tvb, ++ offset, IPV4_SUBNET_MASK_LEN, ENC_BIG_ENDIAN); + offset += IPV4_SUBNET_MASK_LEN; +- proto_tree_add_item(tree, hf_smcr_proposal_outgoing_subnet_mask_signifcant_bits, tvb, +- offset, 1, ENC_BIG_ENDIAN); ++ proto_tree_add_item(tree, hf_smc_proposal_outgoing_subnet_mask_signifcant_bits, tvb, ++ offset, 1, ENC_BIG_ENDIAN); + offset += 1; + /* Bump past reserved bytes */ + offset += TWO_BYTE_RESERVED; + ipv6_prefix_count = tvb_get_guint8(tvb, offset); +- offset += 2; ++ offset += 1; + + while (ipv6_prefix_count != 0) { +- proto_tree_add_item(tree, hf_smcr_proposal_ipv6_prefix, tvb, ++ proto_tree_add_item(tree, hf_smc_proposal_ipv6_prefix, tvb, + offset, IPV6_PREFIX_LEN, ENC_NA); + offset += IPV6_PREFIX_LEN; +- proto_tree_add_item(tree, hf_smcr_proposal_ipv6_prefix_length, tvb, ++ proto_tree_add_item(tree, hf_smc_proposal_ipv6_prefix_length, tvb, + offset, 1, ENC_BIG_ENDIAN); + offset += 1; + ipv6_prefix_count--; + } ++ ++ if (v2_ext_pos >= offset) { ++ offset = v2_ext_pos; ++ num_of_eids = tvb_get_guint8(tvb, offset); ++ offset += FLAG_BYTE_LEN; ++ num_of_gids = tvb_get_guint8(tvb, offset); ++ offset += FLAG_BYTE_LEN; ++ /*Skip reserved flag 1*/ ++ offset += 1; ++ proposal_flag_item = proto_tree_add_item(tree, hf_smc_proposal_ext_flags, tvb, ++ offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ proposal_flag_tree = proto_item_add_subtree(proposal_flag_item, ett_proposal_ext_flag2); ++ proto_tree_add_item(proposal_flag_tree, hf_proposal_smc_version_release_number, ++ tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ proto_tree_add_item(proposal_flag_tree, hf_proposal_smc_version_seid, tvb, ++ offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ offset += FLAG_BYTE_LEN; ++ /*Skip not used 2 bytes*/ ++ offset += 2; ++ smcd_v2_ext_offset = tvb_get_ntohs(tvb, offset); ++ offset += 2; ++ smcd_v2_ext_pos = offset + smcd_v2_ext_offset; ++ ++ if (is_ipv6) { ++ proto_tree_add_item(tree, hf_smc_proposal_rocev2_gid_ipv6_addr, tvb, ++ offset, GID_LEN, ENC_NA); ++ offset += GID_LEN; ++ } ++ else { ++ offset += 12; ++ proto_tree_add_item(tree, hf_smc_proposal_rocev2_gid_ipv4_addr, tvb, ++ offset, IPV4_SUBNET_MASK_LEN, ENC_BIG_ENDIAN); ++ offset += IPV4_SUBNET_MASK_LEN; ++ } ++ /*Skip reserved 16 bytes*/ ++ offset += 16; ++ while (num_of_eids != 0) { ++ proto_tree_add_item(tree, hf_smc_proposal_eid, tvb, ++ offset, EID_LEN, ENC_ASCII | ENC_NA); ++ offset += EID_LEN; ++ num_of_eids--; ++ } ++ if (smcd_v2_ext_pos >= offset) { ++ offset = smcd_v2_ext_pos; ++ proto_tree_add_item(tree, hf_smc_proposal_system_eid, tvb, ++ offset, EID_LEN, ENC_ASCII | ENC_NA); ++ offset += EID_LEN; ++ /*Skip reserved 16 bytes*/ ++ offset += 16; ++ while (num_of_gids != 0) { ++ proto_tree_add_item(tree, hf_smc_proposal_ism_gid, tvb, ++ offset, ISM_GID_LEN, ENC_NA); ++ offset += ISM_GID_LEN; ++ proto_tree_add_item(tree, hf_smc_proposal_smc_chid, tvb, offset, ++ ISM_CHID_LEN, ENC_BIG_ENDIAN); ++ offset += ISM_CHID_LEN; ++ num_of_gids--; ++ } ++ } ++ ++ } ++} ++ ++static void ++disect_smcd_accept(tvbuff_t* tvb, proto_tree* tree) ++{ ++ guint offset; ++ proto_item* accept_flag_item; ++ proto_tree* accept_flag_tree; ++ proto_item* accept_flag2_item; ++ proto_tree* accept_flag2_tree; ++ guint8 smc_version, first_contact = 0; ++ ++ offset = CLC_MSG_START_OFFSET; ++ proto_tree_add_item(tree, hf_smc_length, tvb, offset, ++ LENGTH_BYTE_LEN, ENC_BIG_ENDIAN); ++ offset += LENGTH_BYTE_LEN; ++ accept_flag_item = proto_tree_add_item(tree, hf_smcd_accept_flags, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ accept_flag_tree = proto_item_add_subtree(accept_flag_item, ett_smcd_accept_flag); ++ proto_tree_add_item(accept_flag_tree, hf_smcd_accept_smc_version, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ proto_tree_add_item(accept_flag_tree, hf_smcd_accept_first_contact, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ proto_tree_add_item(accept_flag_tree, hf_accept_smc_type, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ smc_version = tvb_get_guint8(tvb, offset); ++ first_contact = tvb_get_guint8(tvb, offset); ++ smc_version = ((smc_version >> 4) & 0x0F); ++ first_contact = ((first_contact >> 3) & 0x01); ++ offset += FLAG_BYTE_LEN; ++ proto_tree_add_item(tree, hf_smcd_accept_server_peer_id, tvb, offset, ++ PEERID_LEN, ENC_BIG_ENDIAN); ++ offset += PEERID_LEN; ++ ++ proto_tree_add_item(tree, hf_smcd_accept_dmb_token, tvb, ++ offset, DMB_TOKEN_LEN, ENC_NA); ++ offset += DMB_TOKEN_LEN; ++ ++ proto_tree_add_item(tree, hf_smcd_accept_dmbe_conn_index, tvb, ++ offset, CONN_INDEX_LEN, ENC_BIG_ENDIAN); ++ offset += CONN_INDEX_LEN; ++ ++ accept_flag2_item = proto_tree_add_item(tree, hf_smcd_accept_flags2, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ accept_flag2_tree = proto_item_add_subtree(accept_flag2_item, ett_smcd_accept_flag2); ++ proto_tree_add_item(accept_flag2_tree, hf_accept_dmb_buffer_size, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ offset += FLAG_BYTE_LEN; ++ offset += TWO_BYTE_RESERVED; ++ proto_tree_add_item(tree, hf_smcd_accept_server_link_id, tvb, ++ offset, ALERT_TOKEN_LEN, ENC_BIG_ENDIAN); ++ offset += ALERT_TOKEN_LEN; ++ ++ if (smc_version >= SMC_V2) { ++ proto_tree_add_item(tree, hf_smcd_accept_smc_chid, tvb, offset, ++ LENGTH_BYTE_LEN, ENC_BIG_ENDIAN); ++ offset += LENGTH_BYTE_LEN; ++ ++ proto_tree_add_item(tree, hf_smcd_accept_eid, tvb, offset, 32, ENC_ASCII | ENC_NA); ++ offset += 32; ++ /* Reserved bytes */ ++ offset += 8; ++ ++ if (first_contact) { ++ offset += ONE_BYTE_RESERVED; ++ accept_flag_item = proto_tree_add_item(tree, hf_smcd_accept_fce_flags, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ accept_flag_tree = proto_item_add_subtree(accept_flag_item, ett_smcd_accept_fce_flag); ++ proto_tree_add_item(accept_flag_tree, hf_accept_os_type, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ proto_tree_add_item(accept_flag_tree, hf_accept_smc_version_release_number, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ offset += FLAG_BYTE_LEN; ++ offset += TWO_BYTE_RESERVED; ++ proto_tree_add_item(tree, hf_smcd_accept_peer_name, tvb, offset, 32, ENC_ASCII | ENC_NA); ++ /* offset += 32; */ ++ } ++ } ++} ++ ++static void ++disect_smcd_confirm(tvbuff_t* tvb, proto_tree* tree) ++{ ++ guint offset; ++ proto_item* confirm_flag_item; ++ proto_tree* confirm_flag_tree; ++ proto_item* confirm_flag2_item; ++ proto_tree* confirm_flag2_tree; ++ guint8 smc_version, first_contact = 0; ++ ++ offset = CLC_MSG_START_OFFSET; ++ proto_tree_add_item(tree, hf_smc_length, tvb, offset, ++ LENGTH_BYTE_LEN, ENC_BIG_ENDIAN); ++ offset += LENGTH_BYTE_LEN; ++ confirm_flag_item = proto_tree_add_item(tree, hf_smcd_confirm_flags, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ confirm_flag_tree = proto_item_add_subtree(confirm_flag_item, ett_smcd_confirm_flag); ++ proto_tree_add_item(confirm_flag_tree, hf_smcd_confirm_smc_version, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ proto_tree_add_item(confirm_flag_tree, hf_smcd_confirm_first_contact, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ proto_tree_add_item(confirm_flag_tree, hf_confirm_smc_type, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ smc_version = tvb_get_guint8(tvb, offset); ++ first_contact = tvb_get_guint8(tvb, offset); ++ smc_version = ((smc_version >> 4) & 0x0F); ++ first_contact = ((first_contact >> 3) & 0x01); ++ offset += FLAG_BYTE_LEN; ++ proto_tree_add_item(tree, hf_smcd_confirm_client_peer_id, tvb, offset, ++ PEERID_LEN, ENC_BIG_ENDIAN); ++ offset += PEERID_LEN; ++ ++ proto_tree_add_item(tree, hf_smcd_confirm_dmb_token, tvb, ++ offset, DMB_TOKEN_LEN, ENC_NA); ++ offset += DMB_TOKEN_LEN; ++ ++ proto_tree_add_item(tree, hf_smcd_confirm_dmbe_conn_index, tvb, ++ offset, CONN_INDEX_LEN, ENC_BIG_ENDIAN); ++ offset += CONN_INDEX_LEN; ++ ++ confirm_flag2_item = proto_tree_add_item(tree, hf_smcd_confirm_flags2, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ confirm_flag2_tree = proto_item_add_subtree(confirm_flag2_item, ett_smcd_confirm_flag2); ++ proto_tree_add_item(confirm_flag2_tree, hf_smcd_confirm_dmb_buffer_size, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ offset += FLAG_BYTE_LEN; ++ offset += TWO_BYTE_RESERVED; ++ proto_tree_add_item(tree, hf_smcd_confirm_client_link_id, tvb, ++ offset, ALERT_TOKEN_LEN, ENC_BIG_ENDIAN); ++ offset += ALERT_TOKEN_LEN; ++ ++ if (smc_version >= SMC_V2) { ++ proto_tree_add_item(tree, hf_smcd_confirm_smc_chid, tvb, offset, ++ LENGTH_BYTE_LEN, ENC_BIG_ENDIAN); ++ offset += LENGTH_BYTE_LEN; ++ ++ proto_tree_add_item(tree, hf_smcd_confirm_eid, tvb, offset, 32, ENC_ASCII | ENC_NA); ++ offset += 32; ++ /* Reserved bytes */ ++ offset += 8; ++ ++ if (first_contact) { ++ offset += ONE_BYTE_RESERVED; ++ confirm_flag_item = proto_tree_add_item(tree, hf_smcd_accept_fce_flags, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ confirm_flag_tree = proto_item_add_subtree(confirm_flag_item, ett_smcd_confirm_fce_flag); ++ proto_tree_add_item(confirm_flag_tree, hf_confirm_os_type, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ proto_tree_add_item(confirm_flag_tree, hf_confirm_smc_version_release_number, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ offset += FLAG_BYTE_LEN; ++ offset += TWO_BYTE_RESERVED; ++ proto_tree_add_item(tree, hf_smcd_confirm_peer_name, tvb, offset, 32, ENC_ASCII | ENC_NA); ++ /* offset += 32; */ ++ } ++ } + } + ++ + static void + disect_smcr_accept(tvbuff_t *tvb, proto_tree *tree) + { +@@ -315,6 +677,9 @@ disect_smcr_accept(tvbuff_t *tvb, proto_tree *tree) + proto_tree *accept_flag2_tree; + + offset = CLC_MSG_START_OFFSET; ++ proto_tree_add_item(tree, hf_smc_length, tvb, offset, ++ LENGTH_BYTE_LEN, ENC_BIG_ENDIAN); ++ offset += LENGTH_BYTE_LEN; + accept_flag_item = proto_tree_add_item(tree, hf_smcr_accept_flags, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); + accept_flag_tree = proto_item_add_subtree(accept_flag_item, ett_accept_flag); + proto_tree_add_item(accept_flag_tree, hf_accept_smc_version, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); +@@ -367,6 +732,9 @@ disect_smcr_confirm(tvbuff_t *tvb, proto_tree *tree) + proto_tree *confirm_flag2_tree; + + offset = CLC_MSG_START_OFFSET; ++ proto_tree_add_item(tree, hf_smc_length, tvb, offset, ++ LENGTH_BYTE_LEN, ENC_BIG_ENDIAN); ++ offset += LENGTH_BYTE_LEN; + confirm_flag_item = proto_tree_add_item(tree, hf_smcr_confirm_flags, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); + confirm_flag_tree = proto_item_add_subtree(confirm_flag_item, ett_confirm_flag); + proto_tree_add_item(confirm_flag_tree, hf_confirm_smc_version, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); +@@ -411,17 +779,41 @@ disect_smcr_confirm(tvbuff_t *tvb, proto_tree *tree) + static void + disect_smcr_decline(tvbuff_t *tvb, proto_tree *tree) + { +- guint offset; ++ proto_item* decline_flag_item; ++ proto_tree* decline_flag_tree; ++ proto_item* decline_flag2_item; ++ proto_tree* decline_flag2_tree; ++ guint offset, smc_version; + + offset = CLC_MSG_START_OFFSET; +- proto_tree_add_item(tree, hf_smcr_decline_flags, tvb, offset, ++ proto_tree_add_item(tree, hf_smc_length, tvb, offset, ++ LENGTH_BYTE_LEN, ENC_BIG_ENDIAN); ++ offset += LENGTH_BYTE_LEN; ++ ++ decline_flag_item = proto_tree_add_item(tree, hf_smc_decline_flags, tvb, offset, ++ FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ decline_flag_tree = proto_item_add_subtree(decline_flag_item, ett_decline_flag); ++ proto_tree_add_item(decline_flag_tree, hf_decline_smc_version, tvb, offset, ++ FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ proto_tree_add_item(decline_flag_tree, hf_decline_out_of_sync, tvb, offset, + FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ smc_version = tvb_get_guint8(tvb, offset); ++ smc_version = ((smc_version >> 4) & 0x0F); ++ + offset += FLAG_BYTE_LEN; +- proto_tree_add_item(tree, hf_smcr_decline_peer_id, tvb, offset, ++ proto_tree_add_item(tree, hf_smc_decline_peer_id, tvb, offset, + PEERID_LEN, ENC_BIG_ENDIAN); + offset += PEERID_LEN; +- proto_tree_add_item(tree, hf_smcr_decline_diag_info, tvb, offset, +- 4, ENC_BIG_ENDIAN); ++ proto_tree_add_item(tree, hf_smc_decline_diag_info, tvb, offset, ++ DIAG_INFO_LEN, ENC_BIG_ENDIAN); ++ offset += DIAG_INFO_LEN; ++ if (smc_version >= SMC_V2) { ++ decline_flag2_item = proto_tree_add_item(tree, hf_smc_decline_flags2, tvb, offset, ++ FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ decline_flag2_tree = proto_item_add_subtree(decline_flag2_item, ett_decline_flag2); ++ proto_tree_add_item(decline_flag2_tree, hf_decline_os_type, tvb, offset, ++ FLAG_BYTE_LEN, ENC_BIG_ENDIAN); ++ } + } + + static void +@@ -730,50 +1122,126 @@ disect_smcr_rmbe_ctrl(tvbuff_t *tvb, proto_tree *tree) + tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); + } + ++static guint8 get_mixed_type(guint8 v1_type, guint8 v2_type) ++{ ++ if (v1_type == SMC_CLC_BOTH) ++ return v1_type; ++ ++ if (v1_type == SMC_CLC_NONE) ++ return v2_type; ++ ++ if (((v2_type == SMC_CLC_SMCD) && (v1_type == SMC_CLC_SMCR)) || ++ ((v2_type == SMC_CLC_SMCR) && (v1_type == SMC_CLC_SMCD))) ++ return SMC_CLC_BOTH; ++ ++ return v2_type; ++} ++ + static int +-dissect_smcr_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ++dissect_smc_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, + void *data _U_) + { + gint offset; + guint16 msg_len; ++ guint8 smc_type, smc_v2_type = 0, smc_v1_type = 0, smc_version = 0; ++ guint8 mixed_type; + clc_message clc_msgid; + proto_item *ti; +- proto_tree *smcr_tree; ++ proto_tree *smc_tree; ++ bool is_ipv6, is_smc_v2, is_smcd = false; + +- col_set_str(pinfo->cinfo, COL_PROTOCOL, "SMC-R"); + msg_len = tvb_get_ntohs(tvb, CLC_MSG_LEN_OFFSET); + offset = 4; +- clc_msgid = (clc_message) tvb_get_guint8(tvb, offset); +- col_prepend_fstr(pinfo->cinfo, COL_INFO, "[SMC-R-%s],", +- val_to_str_const((guint32)clc_msgid, +- smcr_clc_message_txt, "Unknown Command")); ++ clc_msgid = (clc_message)tvb_get_guint8(tvb, offset); + +- if ((clc_msgid == SMC_CLC_ACCEPT) || +- (clc_msgid == SMC_CLC_CONFIRMATION)) { ++ smc_version = tvb_get_guint8(tvb, offset + 3); ++ smc_version = ((smc_version >> 4) & 0x0F); ++ smc_type = tvb_get_guint8(tvb, offset + 3); ++ is_smc_v2 = (smc_version >= SMC_V2); ++ ++ if (is_smc_v2 && (clc_msgid == SMC_CLC_PROPOSAL)) { ++ smc_v1_type = (smc_type & 0x03); ++ smc_v2_type = ((smc_type >> 2) & 0x03); ++ } ++ else if (clc_msgid != SMC_CLC_DECLINE) { ++ smc_v2_type = (smc_type & 0x03); ++ smc_v1_type = (smc_type & 0x03); ++ } ++ ++ is_ipv6 = (pinfo->src.type == AT_IPv6); ++ ++ if (is_smc_v2) ++ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SMCv2"); ++ else ++ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SMC"); ++ ++ if (clc_msgid == SMC_CLC_PROPOSAL) { ++ if (is_smc_v2 && (smc_v2_type != SMC_CLC_NONE)) { ++ mixed_type = get_mixed_type(smc_v1_type, smc_v2_type); ++ col_prepend_fstr(pinfo->cinfo, COL_INFO, "%s,", ++ val_to_str_const((guint32)mixed_type, ++ smcv2_clc_col_info_message_txt, "Unknown Command")); ++ } else { ++ col_prepend_fstr(pinfo->cinfo, COL_INFO, "%s,", ++ val_to_str_const((guint32)smc_v1_type, ++ smc_clc_col_info_message_txt, "Unknown Command")); ++ } ++ } else if ((smc_v2_type == SMC_CLC_SMCR) && ((clc_msgid == SMC_CLC_ACCEPT) || ++ (clc_msgid == SMC_CLC_CONFIRMATION))) { ++ col_prepend_fstr(pinfo->cinfo, COL_INFO, "[SMC-R-%s],", ++ val_to_str_const((guint32)clc_msgid, ++ smcr_clc_message_txt, "Unknown Command")); + col_append_fstr(pinfo->cinfo, COL_INFO, " QP=0x%06x", + tvb_get_ntoh24(tvb, ACCEPT_CONFIRM_QP_OFFSET)); + } ++ else if ((smc_v2_type == SMC_CLC_SMCD) && ((clc_msgid == SMC_CLC_ACCEPT) || ++ (clc_msgid == SMC_CLC_CONFIRMATION))) { ++ is_smcd = true; ++ if (is_smc_v2) ++ col_prepend_fstr(pinfo->cinfo, COL_INFO, "[SMC-Dv2-%s],", ++ val_to_str_const((guint32)clc_msgid, ++ smcr_clc_message_txt, "Unknown Command")); ++ else ++ col_prepend_fstr(pinfo->cinfo, COL_INFO, "[SMC-D-%s],", ++ val_to_str_const((guint32)clc_msgid, ++ smcr_clc_message_txt, "Unknown Command")); ++ } ++ else { ++ if (is_smc_v2) ++ col_prepend_fstr(pinfo->cinfo, COL_INFO, "[SMCv2-%s],", ++ val_to_str_const((guint32)clc_msgid, ++ smcr_clc_message_txt, "Unknown Command")); ++ else ++ col_prepend_fstr(pinfo->cinfo, COL_INFO, "[SMC-%s],", ++ val_to_str_const((guint32)clc_msgid, ++ smcr_clc_message_txt, "Unknown Command")); ++ } + + if (!tree) + return tvb_reported_length(tvb); + +- ti = proto_tree_add_item(tree, proto_smcr, tvb, 0, msg_len, ENC_NA); +- smcr_tree = proto_item_add_subtree(ti, ett_smcr); +- proto_tree_add_item(smcr_tree, hf_smcr_clc_msg, tvb, offset, 1, ++ ti = proto_tree_add_item(tree, proto_smc, tvb, 0, msg_len, ENC_NA); ++ smc_tree = proto_item_add_subtree(ti, ett_smcr); ++ proto_tree_add_item(smc_tree, hf_smcr_clc_msg, tvb, offset, 1, + ENC_BIG_ENDIAN); +- + switch (clc_msgid) { + case SMC_CLC_PROPOSAL: +- disect_smcr_proposal(tvb, smcr_tree); ++ disect_smc_proposal(tvb, smc_tree, is_ipv6); + break; + case SMC_CLC_ACCEPT: +- disect_smcr_accept(tvb, smcr_tree); ++ if (is_smcd) ++ disect_smcd_accept(tvb, smc_tree); ++ else ++ disect_smcr_accept(tvb, smc_tree); + break; + case SMC_CLC_CONFIRMATION: +- disect_smcr_confirm(tvb, smcr_tree); ++ if (is_smcd) ++ disect_smcd_confirm(tvb, smc_tree); ++ else ++ disect_smcr_confirm(tvb, smc_tree); + break; + case SMC_CLC_DECLINE: +- disect_smcr_decline(tvb, smcr_tree); ++ disect_smcr_decline(tvb, smc_tree); + break; + default: + /* Unknown Command */ +@@ -802,7 +1270,7 @@ dissect_smcr_infiniband(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi + (tvb_get_guint8(tvb, LLC_CMD_RSP_OFFSET) & LLC_FLAG_RESP)) + col_append_str(pinfo->cinfo, COL_INFO, "(Resp)"); + +- ti = proto_tree_add_item(tree, proto_smcr, tvb, 0, msg_len, ENC_NA); ++ ti = proto_tree_add_item(tree, proto_smc, tvb, 0, msg_len, ENC_NA); + smcr_tree = proto_item_add_subtree(ti, ett_smcr); + proto_tree_add_item(smcr_tree, hf_smcr_llc_msg, tvb, 0, 1, + ENC_BIG_ENDIAN); +@@ -861,24 +1329,27 @@ get_smcr_pdu_length(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *dat + } + + static int +-dissect_smcr_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ++dissect_smc_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, + void *data) + { +- tcp_dissect_pdus(tvb, pinfo, tree, TRUE, SMCR_TCP_MIN_HEADER_LENGTH, +- get_smcr_pdu_length, dissect_smcr_tcp_pdu, data); ++ tcp_dissect_pdus(tvb, pinfo, tree, TRUE, SMC_TCP_MIN_HEADER_LENGTH, ++ get_smcr_pdu_length, dissect_smc_tcp_pdu, data); + return tvb_reported_length(tvb); + } + + static gboolean +-dissect_smcr_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ++dissect_smc_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, + void *data) + { + if (tvb_captured_length(tvb) < 4) { + return FALSE; + } + +- if (tvb_get_ntohl(tvb, CLC_MSG_BYTE_0) != SMCR_CLC_ID) return FALSE; +- dissect_smcr_tcp(tvb, pinfo, tree, data); ++ if ((tvb_get_ntohl(tvb, CLC_MSG_BYTE_0) != SMCR_CLC_ID) && ++ (tvb_get_ntohl(tvb, CLC_MSG_BYTE_0) != SMCD_CLC_ID)) ++ return FALSE; ++ ++ dissect_smc_tcp(tvb, pinfo, tree, data); + return TRUE; + } + +@@ -921,479 +1392,688 @@ proto_register_smcr(void) + /* Setup list of header fields */ + static hf_register_info hf[] = { + { &hf_smcr_clc_msg, { +- "CLC Message", "smcr.clc_msg", ++ "CLC Message", "smc.clc_msg", + FT_UINT8, BASE_DEC, VALS(smcr_clc_message_txt), 0x0, + NULL, HFILL}}, + + { &hf_smcr_llc_msg, { +- "LLC Message", "smcr.llc_msg", ++ "LLC Message", "smc.llc_msg", + FT_UINT8, BASE_DEC, VALS(smcr_llc_message_txt), 0x0, + NULL, HFILL}}, + ++ { &hf_proposal_smc_version_release_number, { ++ "SMC Version Release Number", "smc.proposal.smc.version.relnum", ++ FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL }}, ++ ++ { &hf_proposal_smc_version_seid, { ++ "SEID Indicator", "smc.proposal.smc.seid", ++ FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, ++ + { &hf_proposal_smc_version, { +- "SMC Version", "smcr.proposal.smc.version", ++ "SMC Version", "smc.proposal.smc.version", + FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL}}, + ++ { &hf_proposal_smc_type, { ++ "SMC(v1) Type", "smc.proposal.smc.type", ++ FT_UINT8, BASE_DEC, VALS(smc_clc_type_message_txt), ++ 0x03, NULL, HFILL}}, ++ ++ { &hf_accept_smc_type, { ++ "SMC Type", "smc.accept.smc.type", ++ FT_UINT8, BASE_DEC, VALS(smc_clc_type_message_txt), ++ 0x03, NULL, HFILL}}, ++ ++ { &hf_confirm_smc_type, { ++ "SMC Type", "smc.confirm.smc.type", ++ FT_UINT8, BASE_DEC, VALS(smc_clc_type_message_txt), ++ 0x03, NULL, HFILL}}, ++ ++ { &hf_proposal_smc_v2_type, { ++ "SMC(v2) Type", "smc.proposal.smcv2.type", ++ FT_UINT8, BASE_DEC, VALS(smc_clc_type_message_txt), ++ 0x0C, NULL, HFILL}}, ++ ++ { &hf_smc_proposal_smc_chid, { ++ "ISM CHID", "smc.proposal.smc.chid", ++ FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL}}, ++ ++ { &hf_smc_length, { ++ "SMC Length", "smc.length", ++ FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL}}, ++ + { &hf_accept_smc_version, { +- "SMC Version", "smcr.proposal.smc.version", ++ "SMC Version", "smc.proposal.smc.version", ++ FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL}}, ++ ++ { &hf_smcd_accept_smc_version, { ++ "SMC Version", "smc.proposal.smc.version", ++ FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL}}, ++ ++ { &hf_smcd_confirm_smc_version, { ++ "SMC Version", "smc.proposal.smc.version", + FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL}}, + + { &hf_accept_first_contact, { +- "First Contact", "smcr.proposal.first.contact", ++ "First Contact", "smc.proposal.first.contact", + FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}}, + + { &hf_confirm_smc_version, { +- "SMC Version", "smcr.proposal.smc.version", ++ "SMC Version", "smc.proposal.smc.version", + FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL}}, + + { &hf_accept_rmb_buffer_size, { + "Server RMB Buffers Size (Compressed Notation)", +- "smcr.accept.rmb.buffer.size", ++ "smc.accept.rmb.buffer.size", + FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL}}, + + { &hf_accept_qp_mtu_value, { + "QP MTU Value (enumerated value)", +- "smcr.accept.qp.mtu.value", ++ "smc.accept.qp.mtu.value", + FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL}}, + + { &hf_confirm_rmb_buffer_size, { + "Client RMB Buffers Size (Compressed Notation)", +- "smcr.confirm.rmb.buffer.size", ++ "smc.confirm.rmb.buffer.size", + FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL}}, + + { &hf_confirm_qp_mtu_value, { + "QP MTU Value (enumerated value)", +- "smcr.confirm.qp.mtu.value", ++ "smc.confirm.qp.mtu.value", + FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL}}, + +- { &hf_smcr_proposal_flags, { +- "Flags", "smcr.proposal.flags", ++ { &hf_smc_proposal_flags, { ++ "Flags", "smc.proposal.flags", ++ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, ++ ++ { &hf_smc_proposal_ext_flags, { ++ "Flag 2", "smc.proposal.extflags.2", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_accept_flags, { +- "Flags", "smcr.accept.flags", ++ "Flags", "smc.accept.flags", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_accept_flags2, { +- "Flags 2", "smcr.accept.flags.2", ++ "Flags 2", "smc.accept.flags.2", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_flags, { +- "Flags", "smcr.confirm.flags", ++ "Flags", "smc.confirm.flags", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + +- { &hf_smcr_decline_flags, { +- "Flags", "smcr.decline.flags", ++ { &hf_decline_smc_version, { ++ "SMC Version", "smc.decline.smc.version", ++ FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL} }, ++ ++ { &hf_decline_out_of_sync, { ++ "Out of Sync", "smc.decline.osync", ++ FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL} }, ++ ++ { &hf_smc_decline_flags2, { ++ "Flags 2", "smc.decline.flags2", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + ++ { &hf_smc_decline_flags, { ++ "Flags", "smc.decline.flags", ++ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} }, ++ + { &hf_smcr_confirm_flags2, { +- "Flags 2", "smcr.confirm.flags.2", ++ "Flags 2", "smc.confirm.flags.2", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + +- { &hf_smcr_proposal_client_peer_id, { +- "Sender (Client) Peer ID", "smcr.proposal.sender.client.peer.id", ++ { &hf_smc_proposal_client_peer_id, { ++ "Sender (Client) Peer ID", "smc.proposal.sender.client.peer.id", ++ FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}}, ++ ++ { &hf_smc_proposal_ism_gid, { ++ "ISM GID", "smc.proposal.ism.gid", + FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + +- { &hf_smcr_proposal_client_preferred_gid, { +- "Client Preferred GID", "smcr.proposal.client.preferred.gid", ++ { &hf_smc_proposal_client_preferred_gid, { ++ "Client Preferred GID", "smc.proposal.client.preferred.gid", + FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}}, + +- { &hf_smcr_proposal_client_preferred_mac, { ++ { &hf_smc_proposal_client_preferred_mac, { + "Client Preferred MAC Address", +- "smcr.proposal.client.preferred.mac", ++ "smc.proposal.client.preferred.mac", + FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_accept_server_peer_id, { +- "Sender (Server) Peer ID", "smcr.accept.sender.server.peer.id", ++ "Sender (Server) Peer ID", "smc.accept.sender.server.peer.id", + FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_accept_server_preferred_gid, { +- "Server Preferred GID", "smcr.accept.server.preferred.gid", ++ "Server Preferred GID", "smc.accept.server.preferred.gid", + FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_accept_server_preferred_mac, { + "Server Preferred MAC Address", +- "smcr.accept.server.preferred.mac", ++ "smc.accept.server.preferred.mac", + FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL}}, + +- { &hf_smcr_proposal_outgoing_interface_subnet_mask, { ++ { &hf_smc_proposal_rocev2_gid_ipv6_addr, { ++ "RoCEv2 GID IPv6 Address", ++ "smc.proposal.rocev2.gid.ipv6", ++ FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_smc_proposal_rocev2_gid_ipv4_addr, { ++ "RoCEv2 GID IPv4 Address", ++ "smc.proposal.rocev2.gid.ipv4", ++ FT_IPv4, BASE_NETMASK, NULL, 0x0, NULL, HFILL}}, ++ ++ { &hf_smc_proposal_outgoing_interface_subnet_mask, { + "Outgoing Interface Subnet Mask", +- "smcr.outgoing.interface.subnet.mask", ++ "smc.outgoing.interface.subnet.mask", + FT_IPv4, BASE_NETMASK, NULL, 0x0, NULL, HFILL}}, + +- { &hf_smcr_proposal_outgoing_subnet_mask_signifcant_bits, { ++ { &hf_smc_proposal_outgoing_subnet_mask_signifcant_bits, { + "Outgoing Interface Subnet Mask Number of Significant Bits", +- "smcr.outgoing.interface.subnet.mask.number.of.significant.bits", ++ "smc.outgoing.interface.subnet.mask.number.of.significant.bits", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, + +- { &hf_smcr_proposal_ipv6_prefix, { +- "IPv6 Prefix Value","smcr.proposal.ipv6.prefix.value", ++ { &hf_smc_proposal_ipv6_prefix, { ++ "IPv6 Prefix Value","smc.proposal.ipv6.prefix.value", + FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}}, + +- { &hf_smcr_proposal_ipv6_prefix_length, { +- "IPv6 Prefix Length", "smcr.proposal.ipv6.prefix.length", ++ { &hf_smc_proposal_ipv6_prefix_length, { ++ "IPv6 Prefix Length", "smc.proposal.ipv6.prefix.length", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_accept_server_qp_number, { +- "Server QP Number","smcr.accept.server.qp.number", ++ "Server QP Number","smc.accept.server.qp.number", + FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_accept_server_rmb_rkey, { +- "Server RMB Rkey","smcr.accept.server.rmb.rkey", ++ "Server RMB Rkey","smc.accept.server.rmb.rkey", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_accept_server_tcp_conn_index, { + "Server TCP Connection Index", +- "smcr.accept.server.tcp.conn.index", ++ "smc.accept.server.tcp.conn.index", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_accept_server_rmb_element_alert_token, { + "Server RMB Element Alert Token", +- "smcr.accept.server.rmb.element.alert.token", ++ "smc.accept.server.rmb.element.alert.token", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_accept_server_rmb_virtual_address, { + "Server's RMB Virtual Address", +- "smcr.accept.server.rmb.virtual.address", ++ "smc.accept.server.rmb.virtual.address", + FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_accept_initial_psn, { +- "Initial PSN","smcr.accept.initial.psn", ++ "Initial PSN","smc.accept.initial.psn", + FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_client_peer_id, { + "Sender (Client) Peer ID", +- "smcr.confirm.sender.client.peer.id", ++ "smc.confirm.sender.client.peer.id", + FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_client_gid, { +- "Client GID", "smcr.client.gid", ++ "Client GID", "smc.client.gid", + FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_client_mac, { +- "Client MAC Address", "smcr.confirm.client.mac", ++ "Client MAC Address", "smc.confirm.client.mac", + FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_client_qp_number, { +- "Client QP Number","smcr.confirm.client.qp.number", ++ "Client QP Number","smc.confirm.client.qp.number", + FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_client_rmb_rkey, { +- "Client RMB Rkey","smcr.confirm.client.rmb.rkey", ++ "Client RMB Rkey","smc.confirm.client.rmb.rkey", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_client_tcp_conn_index, { + "Client TCP Connection Index", +- "smcr.confirm.client.tcp.conn.index", ++ "smc.confirm.client.tcp.conn.index", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_client_rmb_element_alert_token, { + "Client RMB Element Alert Token", +- "smcr.client.rmb.element.alert.token", ++ "smc.client.rmb.element.alert.token", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_client_rmb_virtual_address, { + "Client's RMB Virtual Address", +- "smcr.client.rmb.virtual.address", ++ "smc.client.rmb.virtual.address", + FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_initial_psn, { +- "Initial PSN","smcr.initial.psn", ++ "Initial PSN","smc.initial.psn", + FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + +- { &hf_smcr_decline_peer_id, { +- "Sender Peer ID", "smcr.sender.peer.id", ++ { &hf_smc_decline_peer_id, { ++ "Sender Peer ID", "smc.sender.peer.id", + FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + +- { &hf_smcr_decline_diag_info, { +- "Peer Diagnosis Information", "smcr.peer.diag.info", ++ { &hf_smc_decline_diag_info, { ++ "Peer Diagnosis Information", "smc.peer.diag.info", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + ++ { &hf_decline_os_type, { ++ "OS Type", "smc.decline.os.type", ++ FT_UINT8, BASE_DEC, VALS(smc_clc_os_message_txt), 0xF0, NULL, HFILL} }, ++ + { &hf_smcr_confirm_link_gid, { +- "Sender GID", "smcr.sender.gid", ++ "Sender GID", "smc.sender.gid", + FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_link_mac, { +- "Sender MAC Address", "smcr.confirm.link.sender.mac", ++ "Sender MAC Address", "smc.confirm.link.sender.mac", + FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_link_qp_number, { +- "Sender QP Number","smcr.confirm.link.sender.qp.number", ++ "Sender QP Number","smc.confirm.link.sender.qp.number", + FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_link_number, { +- "Link Number", "smcr.confirm.link.number", ++ "Link Number", "smc.confirm.link.number", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_link_userid, { + "Sender Link User ID", +- "smcr.confirm.link.sender.link.userid", ++ "smc.confirm.link.sender.link.userid", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_link_max_links, { +- "Max Links","smcr.confirm.link.max.links", ++ "Max Links","smc.confirm.link.max.links", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_link_flags, { +- "Flags", "smcr.confirm.link.flags", ++ "Flags", "smc.confirm.link.flags", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_link_response, { +- "Response", "smcr.confirm.link.response", ++ "Response", "smc.confirm.link.response", + FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, + + { &hf_smcr_add_link_gid, { +- "Sender GID", "smcr.add.link.sender.gid", ++ "Sender GID", "smc.add.link.sender.gid", + FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_add_link_mac, { +- "Sender MAC Address", "smcr.add.link.sender.mac", ++ "Sender MAC Address", "smc.add.link.sender.mac", + FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_add_link_qp_number, { +- "Sender QP Number","smcr.add.link.sender.qp.number", ++ "Sender QP Number","smc.add.link.sender.qp.number", + FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_add_link_number, { +- "Link Number", "smcr.add.link.link.number", ++ "Link Number", "smc.add.link.link.number", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_add_link_initial_psn, { +- "Initial PSN", "smcr.add.link.initial.psn", ++ "Initial PSN", "smc.add.link.initial.psn", + FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_add_link_flags, { +- "Flags", "smcr.add.link.flags", ++ "Flags", "smc.add.link.flags", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_add_link_response, { +- "Add Link Response", "smcr.add.link.response", ++ "Add Link Response", "smc.add.link.response", + FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, + + { &hf_smcr_add_link_response_rejected, { +- "Add Link Rejected", "smcr.add.link.response.rejected", ++ "Add Link Rejected", "smc.add.link.response.rejected", + FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}}, + + { &hf_smcr_add_link_flags2, { +- "Flags", "smcr.add.link.flags2", ++ "Flags", "smc.add.link.flags2", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, + + { &hf_smcr_add_link_qp_mtu_value, { +- "QP MTU Value", "smcr.add.link.qp.mtu.value", ++ "QP MTU Value", "smc.add.link.qp.mtu.value", + FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}}, + + { &hf_smcr_add_link_cont_flags, { +- "Flags", "smcr.add.link.cont.flags", ++ "Flags", "smc.add.link.cont.flags", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_add_link_cont_response, { +- "Response", "smcr.add.link.cont.response", ++ "Response", "smc.add.link.cont.response", + FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, + + { &hf_smcr_add_link_cont_link_number, { +- "Link Number", "smcr.add.link.cont.link.number", ++ "Link Number", "smc.add.link.cont.link.number", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL}}, + + { &hf_smcr_add_link_cont_number_of_rkeys, { +- "Number of Rkeys", "smcr.add.link.cont.rkey.number", ++ "Number of Rkeys", "smc.add.link.cont.rkey.number", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL}}, + + { &hf_smcr_add_link_cont_p1_rkey, { + "RMB RToken Pair 1 - Rkey as known on this SMC Link", +- "smcr.add.link.cont.rmb.RTok1.Rkey1", ++ "smc.add.link.cont.rmb.RTok1.Rkey1", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_add_link_cont_p1_rkey2, { + "RMB RToken Pair 1 - Equivalent Rkey for the new SMC Link", +- "smcr.add.link.cont.rmb.RTok1.Rkey2", ++ "smc.add.link.cont.rmb.RTok1.Rkey2", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_add_link_cont_p1_virt_addr, { + "RMB RToken Pair 1 Virtual Address for the new SMC Link", +- "smcr.add.link.cont.rmb.RTok1.virt", ++ "smc.add.link.cont.rmb.RTok1.virt", + FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_add_link_cont_p2_rkey, { + "RMB RToken Pair 2 - Rkey as known on this SMC Link", +- "smcr.add.link.cont.rmb.RTok2.Rkey1", ++ "smc.add.link.cont.rmb.RTok2.Rkey1", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_add_link_cont_p2_rkey2, { + "RMB RToken Pair 2 - Equivalent Rkey for the new SMC Link", +- "smcr.add.link.cont.rmb.RTok2.Rkey2", ++ "smc.add.link.cont.rmb.RTok2.Rkey2", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_add_link_cont_p2_virt_addr, { + "RMB RToken Pair 2 Virtual Address for the new SMC Link", +- "smcr.add.link.cont.rmb.RTok1.virt", ++ "smc.add.link.cont.rmb.RTok1.virt", + FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_delete_link_flags, { +- "Flags", "smcr.delete.link.flags", ++ "Flags", "smc.delete.link.flags", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_delete_link_response, { +- "Response", "smcr.delete.link.response", ++ "Response", "smc.delete.link.response", + FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, + + { &hf_smcr_delete_link_all, { + "Terminate All Links In The Link Group", +- "smcr.delete.link.all", ++ "smc.delete.link.all", + FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}}, + + { &hf_smcr_delete_link_orderly, { +- "Terminate Links Orderly", "smcr.delete.link.orderly", ++ "Terminate Links Orderly", "smc.delete.link.orderly", + FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}}, + + { &hf_smcr_delete_link_number, { +- "Link Number For The Failed Link", "smcr.delete.link.number", ++ "Link Number For The Failed Link", "smc.delete.link.number", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL}}, + + { &hf_smcr_delete_link_reason_code, { +- "Reason Code", "smcr.delete.link.reason.code", ++ "Reason Code", "smc.delete.link.reason.code", + FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL}}, + + { &hf_smcr_confirm_rkey_flags, { +- "Flags", "smcr.confirm.rkey.flags", ++ "Flags", "smc.confirm.rkey.flags", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_rkey_response, { +- "Response", "smcr.confirm.rkey.response", ++ "Response", "smc.confirm.rkey.response", + FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, + + { &hf_smcr_confirm_rkey_negative_response, { +- "Negative Response", "smcr.confirm.rkey.negative.response", ++ "Negative Response", "smc.confirm.rkey.negative.response", + FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}}, + + { &hf_smcr_confirm_rkey_retry_rkey_set, { +- "Retry Rkey Set", "smcr.confirm.rkey.retry.rkey.set", ++ "Retry Rkey Set", "smc.confirm.rkey.retry.rkey.set", + FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}}, + + { &hf_smcr_confirm_rkey_number, { +- "Number of other QP", "smcr.confirm.rkey.number.qp", ++ "Number of other QP", "smc.confirm.rkey.number.qp", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL}}, + + { &hf_smcr_confirm_rkey_new_rkey, { +- "New Rkey for this link","smcr.confirm.rkey.new.rkey", ++ "New Rkey for this link","smc.confirm.rkey.new.rkey", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_rkey_virtual_address, { + "New RMB virtual address for this link", +- "smcr.confirm.rkey.new.virt", ++ "smc.confirm.rkey.new.virt", + FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_confirm_rkey_link_number, { +- "Link Number", "smcr.confirm.rkey.link.number", ++ "Link Number", "smc.confirm.rkey.link.number", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL}}, + + { &hf_smcr_delete_rkey_flags, { +- "Flags", "smcr.delete.rkey.flags", ++ "Flags", "smc.delete.rkey.flags", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_delete_rkey_response, { +- "Response", "smcr.delete.rkey.response", ++ "Response", "smc.delete.rkey.response", + FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, + + { &hf_smcr_delete_rkey_negative_response, { +- "Negative Response", "smcr.delete.rkey.negative.response", ++ "Negative Response", "smc.delete.rkey.negative.response", + FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}}, + + { &hf_smcr_delete_rkey_mask, { +- "Error Mask", "smcr.delete.rkey.error.mask", ++ "Error Mask", "smc.delete.rkey.error.mask", + FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL}}, + + { &hf_smcr_delete_rkey_deleted, { +- "RMB Rkey to be deleted", "smcr.delete.rkey.deleted", ++ "RMB Rkey to be deleted", "smc.delete.rkey.deleted", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_test_link_flags, { +- "Flags", "smcr.test.link.flags", ++ "Flags", "smc.test.link.flags", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_test_link_response, { +- "Response", "smcr.test.link.response", ++ "Response", "smc.test.link.response", + FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, + + { &hf_smcr_rmbe_ctrl_seqno, { +- "Sequence Number", "smcr.rmbe.ctrl.seqno", ++ "Sequence Number", "smc.rmbe.ctrl.seqno", + FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_rmbe_ctrl_alert_token, { +- "Alert Token", "smcr.rmbe.ctrl.alert.token", ++ "Alert Token", "smc.rmbe.ctrl.alert.token", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + ++ { &hf_smc_proposal_eid, { ++ "EID", "smc.proposal.eid", ++ FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_smc_proposal_system_eid, { ++ "SEID", "smc.proposal.system.eid", ++ FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL} }, ++ + { &hf_smcr_rmbe_ctrl_prod_wrap_seqno, { + "Producer window wrap sequence number", +- "smcr.rmbe.ctrl.prod.wrap.seq", ++ "smc.rmbe.ctrl.prod.wrap.seq", + FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_rmbe_ctrl_peer_prod_curs, { +- "Peer Producer Cursor", "smcr.rmbe.ctrl.peer.prod.curs", ++ "Peer Producer Cursor", "smc.rmbe.ctrl.peer.prod.curs", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, + + { &hf_smcr_rmbe_ctrl_cons_wrap_seqno, { + "Consumer window wrap sequence number", +- "smcr.rmbe.ctrl.prod.wrap.seq", ++ "smc.rmbe.ctrl.prod.wrap.seq", + FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_rmbe_ctrl_peer_cons_curs, { +- "Peer Consumer Cursor", "smcr.rmbe.ctrl.peer.prod.curs", ++ "Peer Consumer Cursor", "smc.rmbe.ctrl.peer.prod.curs", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_rmbe_ctrl_conn_rw_status_flags, { + "Connection read/write status flags", +- "smcr.rmbe.ctrl.conn.rw.status.flags", ++ "smc.rmbe.ctrl.conn.rw.status.flags", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_rmbe_ctrl_write_blocked, { +- "Write Blocked", "smcr.rmbe.ctrl.write.blocked", ++ "Write Blocked", "smc.rmbe.ctrl.write.blocked", + FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, + + { &hf_smcr_rmbe_ctrl_urgent_pending, { +- "Urgent Data Pending", "smcr.rmbe.ctrl.urgent.pending", ++ "Urgent Data Pending", "smc.rmbe.ctrl.urgent.pending", + FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}}, + + { &hf_smcr_rmbe_ctrl_urgent_present, { +- "Urgent Data Present", "smcr.rmbe.ctrl.urgent.present", ++ "Urgent Data Present", "smc.rmbe.ctrl.urgent.present", + FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}}, + + { &hf_smcr_rmbe_ctrl_cons_update_requested, { + "Consumer Cursor Update Requested", +- "smcr.rmbe.ctrl.cons.update.requested", ++ "smc.rmbe.ctrl.cons.update.requested", + FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}}, + + { &hf_smcr_rmbe_ctrl_failover_validation, { + "Failover Validation Indicator", +- "smcr.rmbe.ctrl.failover.validation", ++ "smc.rmbe.ctrl.failover.validation", + FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}}, + + { &hf_smcr_rmbe_ctrl_peer_conn_state_flags, { + "Peer Connection State Flags", +- "smcr.rmbe.ctrl.peer.conn.state.flags", ++ "smc.rmbe.ctrl.peer.conn.state.flags", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + { &hf_smcr_rmbe_ctrl_peer_sending_done, { +- "Peer Sending Done", "smcr.rmbe.ctrl.peer.sending.done", ++ "Peer Sending Done", "smc.rmbe.ctrl.peer.sending.done", + FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}}, + + { &hf_smcr_rmbe_ctrl_peer_closed_conn, { +- "Peer Closed Connection", "smcr.rmbe.ctrl.peer.closed.conn", ++ "Peer Closed Connection", "smc.rmbe.ctrl.peer.closed.conn", + FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}}, + + { &hf_smcr_rmbe_ctrl_peer_abnormal_close, { +- "Peer Abnormal Close", "smcr.rmbe.ctrl.peer.abnormal.close", +- FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}} ++ "Peer Abnormal Close", "smc.rmbe.ctrl.peer.abnormal.close", ++ FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}}, ++ ++ { &hf_smcd_accept_eid, { ++ "EID", "smc.accept.eid", ++ FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_smcd_confirm_eid, { ++ "EID", "smc.confirm.eid", ++ FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_smcd_accept_peer_name, { ++ "Peer Host Name", "smc.accept.peer.host.name", ++ FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_smcd_confirm_peer_name, { ++ "Peer Host Name", "smc.confirm.peer.host.name", ++ FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_smcd_accept_first_contact, { ++ "First Contact", "smc.accept.first.contact", ++ FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL} }, ++ ++ { &hf_smcd_confirm_first_contact, { ++ "First Contact", "smc.confirm.first.contact", ++ FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL} }, ++ ++ { &hf_accept_smc_version_release_number, { ++ "SMC Version Release Number", "smc.accept.smc.version.relnum", ++ FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, ++ ++ { &hf_confirm_smc_version_release_number, { ++ "SMC Version Release Number", "smc.confirm.smc.version.relnum", ++ FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, ++ ++ { &hf_accept_os_type, { ++ "OS Type", "smc.accept.os.type", ++ FT_UINT8, BASE_DEC, VALS(smc_clc_os_message_txt), 0xF0, NULL, HFILL} }, ++ ++ { &hf_confirm_os_type, { ++ "OS Type", "smc.confirm.os.type", ++ FT_UINT8, BASE_DEC, VALS(smc_clc_os_message_txt), 0xF0, NULL, HFILL} }, ++ ++ { &hf_smcd_accept_dmb_token, { ++ "DMB Token", "smc.accept.dmb.token", ++ FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_smcd_confirm_dmb_token, { ++ "DMB Token", "smc.confirm.dmb.token", ++ FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_accept_dmb_buffer_size, { ++ "Server DMBE Buffers Size (Compressed Notation)", ++ "smc.accept.dmbe.buffer.size", ++ FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL} }, ++ ++ { &hf_smcd_confirm_dmb_buffer_size, { ++ "Client DMBE Buffers Size (Compressed Notation)", ++ "smc.confirm.dmbe.buffer.size", ++ FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL} }, ++ ++ { &hf_smcd_accept_smc_chid, { ++ "ISM CHID", "smc.accept.smc.chid", ++ FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL} }, ++ ++ { &hf_smcd_confirm_smc_chid, { ++ "ISM CHID", "smc.confirm.smc.chid", ++ FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL} }, ++ ++ { &hf_smcd_accept_server_peer_id, { ++ "Sender (Server) ISM GID", "smc.accept.sender.server.ism.gid", ++ FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_smcd_confirm_client_peer_id, { ++ "Sender (Client) ISM GID", "smc.confirm.sender.client.ism.gid", ++ FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_smcd_accept_dmbe_conn_index, { ++ "DMBE Connection Index", ++ "smc.accept.dmbe.conn.index", ++ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_smcd_accept_server_link_id, { ++ "Server Link ID", ++ "smc.accept.server.linkid", ++ FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_smcd_confirm_dmbe_conn_index, { ++ "DMBE Connection Index", ++ "smc.confirm.dmbe.conn.index", ++ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_smcd_confirm_client_link_id, { ++ "Client Link ID", ++ "smc.confirm.client.linkid", ++ FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_smcd_accept_flags, { ++ "Flags", "smc.accept.flags", ++ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_smcd_confirm_flags, { ++ "Flags", "smc.confirm.flags", ++ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_smcd_accept_flags2, { ++ "DMBE Size", "smc.accept.dmbe.size", ++ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_smcd_confirm_flags2, { ++ "DMBE Size", "smc.confirm.dmbe.size", ++ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_smcd_accept_fce_flags, { ++ "Flags", "smc.accept.fce.flags", ++ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} } + }; + + /* Setup protocol subtree arrays */ +- static gint *ett[] = { ++ static gint* ett[] = { + &ett_smcr, + &ett_proposal_flag, ++ &ett_proposal_ext_flag2, + &ett_accept_flag, + &ett_accept_flag2, ++ &ett_smcd_accept_flag, ++ &ett_smcd_accept_flag2, ++ &ett_smcd_accept_fce_flag, ++ &ett_smcd_confirm_flag, ++ &ett_smcd_confirm_fce_flag, ++ &ett_smcd_confirm_flag2, + &ett_confirm_flag, + &ett_confirm_flag2, + &ett_confirm_link_flag, ++ &ett_decline_flag, ++ &ett_decline_flag2, + &ett_add_link_flag, + &ett_add_link_flag2, + &ett_add_link_cont_flag, +@@ -1405,21 +2085,21 @@ proto_register_smcr(void) + &ett_rmbe_ctrl_peer_conn_state_flag + }; + +- proto_smcr = proto_register_protocol("Shared Memory Communications - RDMA", +- "SMCR", "smcr"); ++ proto_smc = proto_register_protocol("Shared Memory Communications", ++ "SMC", "smc"); + +- proto_register_field_array(proto_smcr, hf, array_length(hf)); ++ proto_register_field_array(proto_smc, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + +- smcr_tcp_handle = register_dissector("smcr", dissect_smcr_tcp, proto_smcr); ++ smc_tcp_handle = register_dissector("smc", dissect_smc_tcp, proto_smc); + } + + void + proto_reg_handoff_smcr(void) + { +- heur_dissector_add("tcp", dissect_smcr_tcp_heur, "Shared Memory Communications over TCP", "smcr_tcp", proto_smcr, HEURISTIC_ENABLE); +- heur_dissector_add("infiniband.payload", dissect_smcr_infiniband_heur, "Shared Memory Communications Infiniband", "smcr_infiniband", proto_smcr, HEURISTIC_ENABLE); +- dissector_add_for_decode_as("infiniband", create_dissector_handle( dissect_smcr_infiniband, proto_smcr ) ); ++ heur_dissector_add("tcp", dissect_smc_tcp_heur, "Shared Memory Communications over TCP", "smc_tcp", proto_smc, HEURISTIC_ENABLE); ++ heur_dissector_add("infiniband.payload", dissect_smcr_infiniband_heur, "Shared Memory Communications Infiniband", "smcr_infiniband", proto_smc, HEURISTIC_ENABLE); ++ dissector_add_for_decode_as("infiniband", create_dissector_handle( dissect_smcr_infiniband, proto_smc ) ); + } + + /* +diff --git a/epan/dissectors/packet-smc.c b/epan/dissectors/packet-smc.c +index 0a4e96e055..6ede4690db 100644 +--- a/epan/dissectors/packet-smc.c ++++ b/epan/dissectors/packet-smc.c +@@ -1,3 +1,6 @@ ++ ++ ++ + /* packet-smc.c + * SMC dissector for wireshark + * By Joe Fowler +@@ -191,6 +194,8 @@ static int hf_smc_proposal_outgoing_subnet_mask_signifcant_bits = -1; + static int hf_smc_proposal_ipv6_prefix = -1; + static int hf_smc_proposal_ipv6_prefix_length = -1; + ++static int hf_smc_reserved = -1; ++ + /* SMC-R Accept */ + static int ett_accept_flag = -1; + static int ett_accept_flag2 = -1; +@@ -427,6 +432,8 @@ disect_smc_proposal(tvbuff_t *tvb, proto_tree *tree, bool is_ipv6) + + if (mask_offset != 0) { + suboffset = offset; ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ suboffset, TWO_BYTE_RESERVED, ENC_NA); + suboffset += TWO_BYTE_RESERVED; + if (is_smcdv1 || is_smcdv2) { + proto_tree_add_item(tree, hf_smc_proposal_ism_gid, tvb, +@@ -439,6 +446,8 @@ disect_smc_proposal(tvbuff_t *tvb, proto_tree *tree, bool is_ipv6) + LENGTH_BYTE_LEN, ENC_BIG_ENDIAN); + } + suboffset += LENGTH_BYTE_LEN; ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ suboffset, TWO_BYTE_RESERVED, ENC_NA); + v2_ext_offset = tvb_get_ntohs(tvb, suboffset); + v2_ext_pos = suboffset + TWO_BYTE_RESERVED + v2_ext_offset; + } +@@ -451,7 +460,8 @@ disect_smc_proposal(tvbuff_t *tvb, proto_tree *tree, bool is_ipv6) + proto_tree_add_item(tree, hf_smc_proposal_outgoing_subnet_mask_signifcant_bits, tvb, + offset, 1, ENC_BIG_ENDIAN); + offset += 1; +- /* Bump past reserved bytes */ ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ offset, TWO_BYTE_RESERVED, ENC_NA); + offset += TWO_BYTE_RESERVED; + ipv6_prefix_count = tvb_get_guint8(tvb, offset); + offset += 1; +@@ -472,7 +482,8 @@ disect_smc_proposal(tvbuff_t *tvb, proto_tree *tree, bool is_ipv6) + offset += FLAG_BYTE_LEN; + num_of_gids = tvb_get_guint8(tvb, offset); + offset += FLAG_BYTE_LEN; +- /*Skip reserved flag 1*/ ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ offset, 1, ENC_NA); + offset += 1; + proposal_flag_item = proto_tree_add_item(tree, hf_smc_proposal_ext_flags, tvb, + offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); +@@ -482,7 +493,8 @@ disect_smc_proposal(tvbuff_t *tvb, proto_tree *tree, bool is_ipv6) + proto_tree_add_item(proposal_flag_tree, hf_proposal_smc_version_seid, tvb, + offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); + offset += FLAG_BYTE_LEN; +- /*Skip not used 2 bytes*/ ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ offset, 2, ENC_NA); + offset += 2; + smcd_v2_ext_offset = tvb_get_ntohs(tvb, offset); + offset += 2; +@@ -499,7 +511,8 @@ disect_smc_proposal(tvbuff_t *tvb, proto_tree *tree, bool is_ipv6) + offset, IPV4_SUBNET_MASK_LEN, ENC_BIG_ENDIAN); + offset += IPV4_SUBNET_MASK_LEN; + } +- /*Skip reserved 16 bytes*/ ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ offset, 16, ENC_NA); + offset += 16; + while (num_of_eids != 0) { + proto_tree_add_item(tree, hf_smc_proposal_eid, tvb, +@@ -512,7 +525,8 @@ disect_smc_proposal(tvbuff_t *tvb, proto_tree *tree, bool is_ipv6) + proto_tree_add_item(tree, hf_smc_proposal_system_eid, tvb, + offset, EID_LEN, ENC_ASCII | ENC_NA); + offset += EID_LEN; +- /*Skip reserved 16 bytes*/ ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ offset, 16, ENC_NA); + offset += 16; + while (num_of_gids != 0) { + proto_tree_add_item(tree, hf_smc_proposal_ism_gid, tvb, +@@ -580,16 +594,21 @@ disect_smcd_accept(tvbuff_t* tvb, proto_tree* tree) + + proto_tree_add_item(tree, hf_smcd_accept_eid, tvb, offset, 32, ENC_ASCII | ENC_NA); + offset += 32; +- /* Reserved bytes */ ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ offset, 8, ENC_NA); + offset += 8; + + if (first_contact) { ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ offset, ONE_BYTE_RESERVED, ENC_NA); + offset += ONE_BYTE_RESERVED; + accept_flag_item = proto_tree_add_item(tree, hf_smcd_accept_fce_flags, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); + accept_flag_tree = proto_item_add_subtree(accept_flag_item, ett_smcd_accept_fce_flag); + proto_tree_add_item(accept_flag_tree, hf_accept_os_type, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); + proto_tree_add_item(accept_flag_tree, hf_accept_smc_version_release_number, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); + offset += FLAG_BYTE_LEN; ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ offset, TWO_BYTE_RESERVED, ENC_NA); + offset += TWO_BYTE_RESERVED; + proto_tree_add_item(tree, hf_smcd_accept_peer_name, tvb, offset, 32, ENC_ASCII | ENC_NA); + /* offset += 32; */ +@@ -637,6 +656,8 @@ disect_smcd_confirm(tvbuff_t* tvb, proto_tree* tree) + confirm_flag2_tree = proto_item_add_subtree(confirm_flag2_item, ett_smcd_confirm_flag2); + proto_tree_add_item(confirm_flag2_tree, hf_smcd_confirm_dmb_buffer_size, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); + offset += FLAG_BYTE_LEN; ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ offset, ONE_BYTE_RESERVED, ENC_NA); + offset += TWO_BYTE_RESERVED; + proto_tree_add_item(tree, hf_smcd_confirm_client_link_id, tvb, + offset, ALERT_TOKEN_LEN, ENC_BIG_ENDIAN); +@@ -649,16 +670,21 @@ disect_smcd_confirm(tvbuff_t* tvb, proto_tree* tree) + + proto_tree_add_item(tree, hf_smcd_confirm_eid, tvb, offset, 32, ENC_ASCII | ENC_NA); + offset += 32; +- /* Reserved bytes */ ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ offset, 8, ENC_NA); + offset += 8; + + if (first_contact) { ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ offset, ONE_BYTE_RESERVED, ENC_NA); + offset += ONE_BYTE_RESERVED; + confirm_flag_item = proto_tree_add_item(tree, hf_smcd_accept_fce_flags, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); + confirm_flag_tree = proto_item_add_subtree(confirm_flag_item, ett_smcd_confirm_fce_flag); + proto_tree_add_item(confirm_flag_tree, hf_confirm_os_type, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); + proto_tree_add_item(confirm_flag_tree, hf_confirm_smc_version_release_number, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); + offset += FLAG_BYTE_LEN; ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ offset, TWO_BYTE_RESERVED, ENC_NA); + offset += TWO_BYTE_RESERVED; + proto_tree_add_item(tree, hf_smcd_confirm_peer_name, tvb, offset, 32, ENC_ASCII | ENC_NA); + /* offset += 32; */ +@@ -711,12 +737,14 @@ disect_smcr_accept(tvbuff_t *tvb, proto_tree *tree) + proto_tree_add_item(accept_flag2_tree, hf_accept_rmb_buffer_size, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); + proto_tree_add_item(accept_flag2_tree, hf_accept_qp_mtu_value, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); + offset += FLAG_BYTE_LEN; +- /* Bump past reserved byte */ ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ offset, ONE_BYTE_RESERVED, ENC_NA); + offset += ONE_BYTE_RESERVED; + proto_tree_add_item(tree, hf_smcr_accept_server_rmb_virtual_address, tvb, + offset, VIRTUAL_ADDR_LEN, ENC_BIG_ENDIAN); + offset += VIRTUAL_ADDR_LEN; +- /* Bump past reserved byte */ ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ offset, ONE_BYTE_RESERVED, ENC_NA); + offset += ONE_BYTE_RESERVED; + proto_tree_add_item(tree, hf_smcr_accept_initial_psn, tvb, + offset, PSN_LEN, ENC_BIG_ENDIAN); +@@ -765,12 +793,14 @@ disect_smcr_confirm(tvbuff_t *tvb, proto_tree *tree) + proto_tree_add_item(confirm_flag2_tree, hf_confirm_rmb_buffer_size, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); + proto_tree_add_item(confirm_flag2_tree, hf_confirm_qp_mtu_value, tvb, offset, FLAG_BYTE_LEN, ENC_BIG_ENDIAN); + offset += FLAG_BYTE_LEN; +- /* Bump past reserved byte */ ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ offset, ONE_BYTE_RESERVED, ENC_NA); + offset += ONE_BYTE_RESERVED; + proto_tree_add_item(tree, hf_smcr_confirm_client_rmb_virtual_address, tvb, + offset, VIRTUAL_ADDR_LEN, ENC_BIG_ENDIAN); + offset += VIRTUAL_ADDR_LEN; +- /* Bump past reserved byte */ ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ offset, ONE_BYTE_RESERVED, ENC_NA); + offset += ONE_BYTE_RESERVED; + proto_tree_add_item(tree, hf_smcr_confirm_initial_psn, tvb, + offset, PSN_LEN, ENC_BIG_ENDIAN); +@@ -866,7 +896,8 @@ disect_smcr_add_link(tvbuff_t *tvb, proto_tree *tree) + proto_tree_add_item(tree, hf_smcr_add_link_mac, tvb, + offset, MAC_ADDR_LEN, ENC_NA); + offset += MAC_ADDR_LEN; +- /* Bump past reserved bytes */ ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, ++ offset, TWO_BYTE_RESERVED, ENC_NA); + offset += TWO_BYTE_RESERVED; + proto_tree_add_item(tree, hf_smcr_add_link_gid, tvb, + offset, GID_LEN, ENC_NA); +@@ -1084,12 +1115,13 @@ disect_smcr_rmbe_ctrl(tvbuff_t *tvb, proto_tree *tree) + offset += SEQNO_LEN; + proto_tree_add_item(tree, hf_smcr_rmbe_ctrl_alert_token, tvb, offset, ALERT_TOKEN_LEN, ENC_BIG_ENDIAN); + offset += ALERT_TOKEN_LEN; ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, offset, TWO_BYTE_RESERVED, ENC_NA); + offset += TWO_BYTE_RESERVED; + proto_tree_add_item(tree, hf_smcr_rmbe_ctrl_prod_wrap_seqno, tvb, offset, SEQNO_LEN, ENC_BIG_ENDIAN); + offset += SEQNO_LEN; + proto_tree_add_item(tree, hf_smcr_rmbe_ctrl_peer_prod_curs, tvb, offset, CURSOR_LEN, ENC_BIG_ENDIAN); + offset += CURSOR_LEN; +- /* Bump past reserved bytes */ ++ proto_tree_add_item(tree, hf_smc_reserved, tvb, offset, TWO_BYTE_RESERVED, ENC_NA); + offset += TWO_BYTE_RESERVED; + proto_tree_add_item(tree, hf_smcr_rmbe_ctrl_cons_wrap_seqno, tvb, offset, SEQNO_LEN, ENC_BIG_ENDIAN); + offset += SEQNO_LEN; +@@ -2053,7 +2085,11 @@ proto_register_smcr(void) + + { &hf_smcd_accept_fce_flags, { + "Flags", "smc.accept.fce.flags", +- FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} } ++ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL} }, ++ ++ { &hf_smc_reserved, { ++ "Reserved", "smc.reserved", ++ FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} } + }; + + /* Setup protocol subtree arrays */ diff --git a/wireshark-0028-find-libssh.patch b/wireshark-0028-find-libssh.patch new file mode 100644 index 0000000..0ec82c7 --- /dev/null +++ b/wireshark-0028-find-libssh.patch @@ -0,0 +1,23 @@ +diff --git a/cmake/modules/FindLIBSSH.cmake b/cmake/modules/FindLIBSSH.cmake +index 46dbe04..65dd5d2 100644 +--- a/cmake/modules/FindLIBSSH.cmake ++++ b/cmake/modules/FindLIBSSH.cmake +@@ -59,15 +59,15 @@ else () + ${LIBSSH_LIBRARY} + ) + +- file(STRINGS ${LIBSSH_INCLUDE_DIR}/libssh/libssh.h LIBSSH_VERSION_MAJOR ++ file(STRINGS ${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h LIBSSH_VERSION_MAJOR + REGEX "#define[ ]+LIBSSH_VERSION_MAJOR[ ]+[0-9]+") + # Older versions of libssh like libssh-0.2 have LIBSSH_VERSION but not LIBSSH_VERSION_MAJOR + if(LIBSSH_VERSION_MAJOR) + string(REGEX MATCH "[0-9]+" LIBSSH_VERSION_MAJOR ${LIBSSH_VERSION_MAJOR}) +- file(STRINGS ${LIBSSH_INCLUDE_DIR}/libssh/libssh.h LIBSSH_VERSION_MINOR ++ file(STRINGS ${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h LIBSSH_VERSION_MINOR + REGEX "#define[ ]+LIBSSH_VERSION_MINOR[ ]+[0-9]+") + string(REGEX MATCH "[0-9]+" LIBSSH_VERSION_MINOR ${LIBSSH_VERSION_MINOR}) +- file(STRINGS ${LIBSSH_INCLUDE_DIR}/libssh/libssh.h LIBSSH_VERSION_PATCH ++ file(STRINGS ${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h LIBSSH_VERSION_PATCH + REGEX "#define[ ]+LIBSSH_VERSION_MICRO[ ]+[0-9]+") + string(REGEX MATCH "[0-9]+" LIBSSH_VERSION_PATCH ${LIBSSH_VERSION_PATCH}) + set(LIBSSH_VERSION ${LIBSSH_VERSION_MAJOR}.${LIBSSH_VERSION_MINOR}.${LIBSSH_VERSION_PATCH}) diff --git a/wireshark.spec b/wireshark.spec new file mode 100644 index 0000000..2c7e29b --- /dev/null +++ b/wireshark.spec @@ -0,0 +1,1234 @@ +%global with_lua 1 +%global with_portaudio 1 +%global with_maxminddb 1 +%global plugins_version 2.6 + +Summary: Network traffic analyzer +Name: wireshark +Version: 2.6.2 +Release: 15%{?dist} +Epoch: 1 +License: GPL+ +Url: http://www.wireshark.org/ + +Source0: https://wireshark.org/download/src/%{name}-%{version}.tar.xz +Source1: https://www.wireshark.org/download/src/all-versions/SIGNATURES-%{version}.txt +Source2: 90-wireshark-usbmon.rules + +# Fedora-specific +%if %{with_lua} && 0%{?fedora} +Patch1: wireshark-0001-enable-Lua-support.patch +%endif +# Fedora-specific +Patch2: wireshark-0002-Customize-permission-denied-error.patch +# Will be proposed upstream +Patch3: wireshark-0003-fix-string-overrun-in-plugins-profinet.patch +# Fedora-specific +Patch4: wireshark-0004-Restore-Fedora-specific-groups.patch +# Fedora-specific +Patch5: wireshark-0005-Fix-paths-in-a-wireshark.desktop-file.patch +# Fedora-specific +Patch6: wireshark-0006-Move-tmp-to-var-tmp.patch +Patch7: wireshark-0007-cmakelists.patch +#Various CVEs in RHEL-8 +Patch8: wireshark-0008-CVE-2018-16056.patch +Patch9: wireshark-0009-CVE-2018-16057.patch +Patch10: wireshark-0010-CVE-2018-16058.patch +Patch11: wireshark-0011-tshark-missing-N-option.patch + +#CVEs backported from wireshark-2.6.4 +Patch12: wireshark-0012-CVE-12086.patch +Patch13: wireshark-0013-CVE-18225.patch +Patch14: wireshark-0014-CVE-18226.patch +Patch15: wireshark-0015-CVE-18227.patch + +#CVEs backported from wireshark-2.6.5 +Patch16: wireshark-0016-CVE-19622.patch +Patch17: wireshark-0017-CVE-19623.patch +Patch18: wireshark-0018-CVE-19624.patch +Patch19: wireshark-0019-CVE-19625.patch +Patch20: wireshark-0020-CVE-19626.patch +Patch21: wireshark-0021-CVE-19627.patch +Patch22: wireshark-0022-CVE-19628.patch + +#Removing deprecated word Application from .desktop file +Patch23: wireshark-0023-desktop-file.patch + +#Fixing a couple of issues found by covscan +Patch24: wireshark-0024-covscan.patch + +Patch25: wireshark-0025-drop-count.patch +Patch26: wireshark-0026-mptcp.patch +Patch27: wireshark-0027-ibm-smc.patch + +#Change in libssh header files forces a different technique on finding definitons +Patch28: wireshark-0028-find-libssh.patch + +#install tshark together with wireshark GUI +Requires: %{name}-cli = %{epoch}:%{version}-%{release} + +Requires: xdg-utils +Requires: hicolor-icon-theme + +%if %{with_portaudio} && 0%{?fedora} +Requires: portaudio +BuildRequires: portaudio-devel +%endif +%if %{with_maxminddb} +Requires: libmaxminddb +%endif + +BuildRequires: bzip2-devel +BuildRequires: c-ares-devel +BuildRequires: elfutils-devel +BuildRequires: gcc-c++ +BuildRequires: glib2-devel +BuildRequires: gnutls-devel +BuildRequires: gtk3-devel +BuildRequires: krb5-devel +BuildRequires: libcap-devel +BuildRequires: libgcrypt-devel +BuildRequires: libnl3-devel +BuildRequires: libpcap-devel >= 0.9 +BuildRequires: libselinux-devel +BuildRequires: libsmi-devel +BuildRequires: openssl-devel +BuildRequires: desktop-file-utils +BuildRequires: xdg-utils +BuildRequires: bison +BuildRequires: flex +BuildRequires: pcre-devel +BuildRequires: perl(Pod::Html) +BuildRequires: perl(Pod::Man) +Buildrequires: libssh-devel +BuildRequires: qt5-linguist +BuildRequires: qt5-qtbase-devel +BuildRequires: qt5-qtmultimedia-devel +BuildRequires: qt5-qtsvg-devel +BuildRequires: zlib-devel +%if %{with_maxminddb} +BuildRequires: libmaxminddb-devel +%endif +%if %{with_lua} && 0%{?fedora} +BuildRequires: compat-lua-devel +%endif +Buildrequires: git +Buildrequires: python3-devel +Buildrequires: cmake +Obsoletes: wireshark-qt, wireshark-gtk + +%description +Wireshark allows you to examine protocol data stored in files or as it is +captured from wired or wireless (WiFi or Bluetooth) networks, USB devices, +and many other sources. It supports dozens of protocol capture file formats +and understands more than a thousand protocols. + +It has many powerful features including a rich display filter language +and the ability to reassemble multiple protocol packets in order to, for +example, view a complete TCP stream, save the contents of a file which was +transferred over HTTP or CIFS, or play back an RTP audio stream. + +%package cli +Summary: Network traffic analyzer +Requires(pre): shadow-utils +Requires(post): systemd-udev + +%description cli +This package contains command-line utilities, plugins, and documentation for +Wireshark. + +%package devel +Summary: Development headers and libraries for wireshark +Requires: %{name} = %{epoch}:%{version}-%{release} glibc-devel glib2-devel +Requires: wireshark-cli = %{epoch}:%{version}-%{release} + +%description devel +The wireshark-devel package contains the header files, developer +documentation, and libraries required for development of wireshark scripts +and plugins. + + +%prep +%autosetup -S git + +%build +%cmake -G "Unix Makefiles" \ + -DDISABLE_WERROR=ON \ + -DBUILD_wireshark=ON \ + -DENABLE_QT5=ON \ +%if %{with_lua} && 0%{?fedora} + -DENABLE_LUA=ON \ +%else + -DENABLE_LUA=OFF \ +%endif +%if %{with_maxminddb} + -DBUILD_mmdbresolve=ON \ +%else + -DBUILD_mmdbresolve=OFF \ +%endif + -DBUILD_randpktdump=OFF \ + -DBUILD_androiddump=OFF \ + -DENABLE_SMI=ON \ +%if %{with_portaudio} && 0%{?fedora} + -DENABLE_PORTAUDIO=ON \ +%else + -DENABLE_PORTAUDIO=OFF \ +%endif + -DENABLE_PLUGINS=ON \ + -DENABLE_NETLINK=ON \ + -DBUILD_dcerpcidl2wrs=OFF + +make %{?_smp_mflags} + +%install +make DESTDIR=%{buildroot} install + +desktop-file-validate %{buildroot}%{_datadir}/applications/wireshark.desktop + +#install devel files (inspired by debian/wireshark-dev.header-files) +install -d -m 0755 %{buildroot}%{_includedir}/wireshark +IDIR="%{buildroot}%{_includedir}/wireshark" +mkdir -p "${IDIR}/epan" +mkdir -p "${IDIR}/epan/crypt" +mkdir -p "${IDIR}/epan/ftypes" +mkdir -p "${IDIR}/epan/dfilter" +mkdir -p "${IDIR}/epan/dissectors" +mkdir -p "${IDIR}/epan/wmem" +mkdir -p "${IDIR}/wiretap" +mkdir -p "${IDIR}/wsutil" +mkdir -p %{buildroot}%{_udevrulesdir} +install -m 644 config.h epan/register.h "${IDIR}/" +install -m 644 cfile.h file.h "${IDIR}/" +install -m 644 ws_symbol_export.h "${IDIR}/" +install -m 644 epan/*.h "${IDIR}/epan/" +install -m 644 epan/crypt/*.h "${IDIR}/epan/crypt" +install -m 644 epan/ftypes/*.h "${IDIR}/epan/ftypes" +install -m 644 epan/dfilter/*.h "${IDIR}/epan/dfilter" +install -m 644 epan/dissectors/*.h "${IDIR}/epan/dissectors" +install -m 644 epan/wmem/*.h "${IDIR}/epan/wmem" +install -m 644 wiretap/*.h "${IDIR}/wiretap" +install -m 644 wsutil/*.h "${IDIR}/wsutil" +install -m 644 ws_diag_control.h "${IDIR}/" +install -m 644 %{SOURCE2} %{buildroot}%{_udevrulesdir} + +touch %{buildroot}%{_bindir}/%{name} + +# Remove libtool archives and static libs +find %{buildroot} -type f -name "*.la" -delete + +#fix multilib install of devel pkg in wireshark-2.6.2(fixed in 3.0.0) +mv %{buildroot}%{_includedir}/wireshark/config.h \ + %{buildroot}%{_includedir}/wireshark/config-%{__isa_bits}.h +cat > %{buildroot}%{_includedir}/wireshark/config.h << EOF +#include + +#if __WORDSIZE == 32 +#include +#elif __WORDSIZE == 64 +#include +#else +#error "Unknown word size" +#endif +EOF + +%pre cli +getent group wireshark >/dev/null || groupadd -r wireshark +getent group usbmon >/dev/null || groupadd -r usbmon + +%post cli +/sbin/ldconfig +/usr/bin/udevadm trigger --subsystem-match=usbmon + +%postun cli -p /sbin/ldconfig + +%files +%{_datadir}/appdata/%{name}.appdata.xml +%{_datadir}/applications/wireshark.desktop +%{_datadir}/icons/hicolor/*/apps/* +%{_datadir}/icons/hicolor/*/mimetypes/* +%{_datadir}/mime/packages/wireshark.xml +%{_bindir}/wireshark +%{_mandir}/man1/wireshark.* + +%files cli +%license COPYING +%doc AUTHORS INSTALL NEWS README* +%{_bindir}/capinfos +%{_bindir}/captype +%{_bindir}/editcap +%{_bindir}/mergecap +%{_bindir}/randpkt +%{_bindir}/reordercap +%{_bindir}/sharkd +%{_bindir}/text2pcap +%{_bindir}/tshark +%if %{with_maxminddb} +%{_bindir}/mmdbresolve +%endif +%attr(0750, root, wireshark) %caps(cap_net_raw,cap_net_admin=ep) %{_bindir}/dumpcap +%{_bindir}/rawshark +%{_udevrulesdir}/90-wireshark-usbmon.rules +%{_libdir}/lib*.so.* +%dir %{_libdir}/wireshark +%dir %{_libdir}/wireshark/extcap +%dir %{_libdir}/wireshark/plugins +%{_libdir}/wireshark/extcap/ciscodump +%{_libdir}/wireshark/extcap/udpdump +%{_libdir}/wireshark/extcap/sshdump +%{_libdir}/wireshark/*.cmake +#the version wireshark uses to store plugins is only x.y, not .z +%{_libdir}/wireshark/plugins/%{plugins_version}/epan/*.so +%{_libdir}/wireshark/plugins/%{plugins_version}/wiretap/*.so +%{_libdir}/wireshark/plugins/%{plugins_version}/codecs/*.so +%{_mandir}/man1/editcap.* +%{_mandir}/man1/tshark.* +%{_mandir}/man1/mergecap.* +%{_mandir}/man1/text2pcap.* +%{_mandir}/man1/capinfos.* +%{_mandir}/man1/dumpcap.* +%{_mandir}/man4/wireshark-filter.* +%{_mandir}/man1/rawshark.* +%{_mandir}/man1/dftest.* +%{_mandir}/man1/randpkt.* +%{_mandir}/man1/reordercap.* +%{_mandir}/man1/sshdump.* +%{_mandir}/man1/udpdump.* +%{_mandir}/man1/androiddump.* +%{_mandir}/man1/captype.* +%{_mandir}/man1/ciscodump.* +%{_mandir}/man1/randpktdump.* +%{_mandir}/man4/extcap.* +%if %{with_maxminddb} +%{_mandir}/man1/mmdbresolve.* +%endif +%dir %{_datadir}/wireshark +%{_datadir}/wireshark/* + +%files devel +%doc doc/README.* ChangeLog +%{_includedir}/wireshark +%{_libdir}/lib*.so +%{_libdir}/pkgconfig/%{name}.pc + +%changelog +* Wed Aug 24 2022 Michal Ruprich - 1:2.6.2-15 +- Resolves: #2119126 - Wireshark source rpm fails to build due to looking for incorrect libssh header files + +* Mon Apr 19 2021 Michal Ruprich - 1:2.6.2-14 +- Resolves: #1851465 - [IBM 8.5 FEAT] wireshark: Update to include SMC support + +* Tue Apr 13 2021 Michal Ruprich - 1:2.6.2-13 +- Resolves: #1934617 - [RFE] better MPTCP dissection support + +* Tue Oct 29 2019 Michal Ruprich - 1:2.6.2-12 +- Resolves: #1609737 - wiretap does not write "drop_count" in pcapng format + +* Mon Apr 29 2019 Michal Ruprich - 1:2.6.2-11 +- Related: #1602731 - Fixing multilib problem in devel subpackage + +* Thu Apr 25 2019 Michal Ruprich - 1:2.6.2-10 +- Resolves: #1602731 - Please review important issues found by covscan + +* Sun Dec 16 2018 Michal Ruprich - 1:2.6.2-9 +- Related: #1642919 - Fixing RPMDiff errors + +* Tue Dec 11 2018 Michal Ruprich - 1:2.6.2-8 +- Related: #1642919 - changing wrong commit message + +* Mon Dec 10 2018 Michal Ruprich - 1:2.6.2-7 +- Resolves: #1642919 - CVE-2018-12086, CVE-2018-18225, CVE-2018-18226, CVE-2018-18227 +- Resolves: #1656342 - CVE-2018-19623 +- Resolves: #1657634 - CVE-2018-19625 +- Resolves: #1657211 - CVE-2018-19626 +- Resolves: #1657184 - CVE-2018-19627 +- Resolves: #1657190 - CVE-2018-19628 +- fixes CVE-2018-19622, CVE-2018-19624 + +* Mon Nov 12 2018 Michal Ruprich - 1:2.6.2-6 +- Resolves: #1584214 - tshark does accept -N v while it shouldn't + +* Thu Sep 27 2018 Michal Ruprich - 1:2.6.2-5 +- Resolves: #1625926 - fixes CVE-2018-16056, CVE-2018-16057, CVE-2018-16058 + +* Mon Aug 27 2018 Michal Ruprich - 1:2.6.2-4 +- Resolves: #1618380 - Rebuild wireshark using libssh-0.8 for RHEL8 + +* Mon Aug 13 2018 Michal Ruprich - 1:2.6.2-3 +- Resolves: #1615412 - FTBFS: wireshark fails to build + +* Thu Aug 02 2018 Michal Ruprich - 1:2.6.2-2 +- Turning on build with libmaxminddb (rhbz#1607934) + +* Mon Jul 23 2018 Michal Ruprich - 1:2.6.2-1 +- New version 2.6.2 +- Contains fixes for CVE-2018-14339, CVE-2018-14340, CVE-2018-14341, CVE-2018-14342, CVE-2018-14343, CVE-2018-14344, CVE-2018-14367, CVE-2018-14368, CVE-2018-14369, CVE-2018-14370 + +* Wed Jul 11 2018 Michal Ruprich - 1:2.6.1-2 +- Fixing build error with newer qt5 version + +* Thu May 24 2018 Michal Ruprich - 1:2.6.1-1 +- New version 2.6.1 +- Contains fixes for multiple CVEs + +* Tue May 15 2018 Michal Ruprich - 1:2.6.0-2 +- Added Obsoletes for wireshark-qt and wireshark-gtk + +* Wed May 02 2018 Michal Ruprich - 1:2.6.0-1 +- New version 2.6.0 +- Fix for CVE-2018-9256, CVE-2018-9257, CVE-2018-9258, CVE-2018-9259, CVE-2018-9260, CVE-2018-9261, CVE-2018-9262, CVE-2018-9263, CVE-2018-9264, CVE-2018-9265, CVE-2018-9266, CVE-2018-9267, CVE-2018-9268, CVE-2018-9269, CVE-2018-9270, CVE-2018-9271, CVE-2018-9272, CVE-2018-9273, CVE-2018-9274 +- Switch from autotools to cmake +- Removed python2-devel(#1560284) and libssh2-devel from dependencies +- Removed python scripts + +* Thu Mar 15 2018 Michal Ruprich - 1:2.4.5-2 +- Removing dependency on wireshark from wireshark-cli +- Removing deprecated Group tags +- Disabling portaudio on RHEL (rhbz#1554834) + +* Fri Mar 09 2018 Michal Ruprich - 1:2.4.5-1 +- New upstream version 2.4.5 +- Contains fixes for CVE-2018-7419, CVE-2018-7418, CVE-2018-7417, CVE-2018-7420, CVE-2018-7320, CVE-2018-7336, CVE-2018-7337, CVE-2018-7334, CVE-2018-7335, CVE-2018-6836, CVE-2018-5335, CVE-2018-5334, CVE-2017-6014, CVE-2017-9616, CVE-2017-9617, CVE-2017-9766 +- Removed GTK+ based GUI (rhbz#1486203) +- Corrected LDFLAGS in spec (rhbz#1548665) +- Alternatives are no longer needed (rhbz#1533701) + +* Fri Feb 09 2018 Igor Gnatenko - 1:2.4.4-2 +- Escape macros in %%changelog + +* Fri Jan 19 2018 Michal Ruprich - 1:2.4.4-1 +- New upstream version 2.4.4 +- Contains fix for CVE-2017-17935 + +* Fri Jan 05 2018 Igor Gnatenko - 1:2.4.3-2 +- Remove obsolete scriptlets + +* Wed Dec 20 2017 Michal Ruprich - 1:2.4.3-1 +- New upstream version 2.4.3 +- Contains fixe for CVE-2017-17085, CVE-2017-17084, CVE-2017-17083 + +* Thu Oct 12 2017 Michal Ruprich - 1:2.4.2-1 +- New upstream version 2.4.2 +- Contains fixes for CVE-2017-15189, CVE-2017-15190, CVE-2017-15191, CVE-2017-15192, CVE-2017-15193, CVE-2017-13764, CVE-2017-13765, CVE-2017-13766, CVE-2017-13767 + +* Tue Aug 08 2017 Martin Sehnoutka - 1:2.4.0-6 +- Use epoch in Requires (rhbz#1478501) + +* Thu Aug 03 2017 Martin Sehnoutka - 1:2.4.0-5 +- Add libssh as a build dependency (rhbz#1419131) + +* Thu Aug 03 2017 Fedora Release Engineering - 2.4.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 2.4.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Jul 21 2017 Martin Sehnoutka - 2.4.0-2 +- Move init.lua file into the main subpackage (rhbz#1463270) + +* Thu Jul 20 2017 Martin Sehnoutka - 2.4.0-2 +- New upstream version 2.4.0 + +* Thu Jun 29 2017 Martin Sehnoutka - 2.4.0rc2-1 +- New upstream version + +* Mon Jun 12 2017 Martin Sehnoutka - 2.2.7-1 +- New upstream release 2.2.7 + +* Thu May 25 2017 Martin Sehnoutka - 2.2.6-5 +- Add triggerin script to remove old alternatives +- Remove appdata.xml as it is provided by upstream now + +* Mon May 15 2017 Fedora Release Engineering - 2.2.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild + +* Mon Apr 24 2017 Martin Sehnoutka - 2.2.6-2 +- Build with lua support (resolves: #1259623) + +* Fri Apr 21 2017 Martin Sehnoutka - 2.2.6-1 +- New upstream release 2.2.6 + +* Fri Apr 07 2017 Igor Gnatenko - 2.2.5-2 +- Stop patching pkg-config + +* Tue Mar 07 2017 Martin Sehnoutka - 2.2.5-1 +- New upstream version 2.2.5 + +* Mon Mar 06 2017 Martin Sehnoutka - 2.2.4-3 +- Fix python_sitearch macro +- Fix path in desktop file + +* Sat Feb 11 2017 Fedora Release Engineering - 2.2.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Jan 25 2017 Martin Sehnoutka - 2.2.4-2 +- New upstream release 2.2.4 + +* Thu Dec 08 2016 Martin Sehnoutka - 2.2.2-4 +- Change update-alternatives name from wireshark to wireshark-gui; Resolve: + #1400654 + +* Thu Dec 01 2016 Martin Sehnoutka - 2.2.2-3 +- Move all executables into /usr/bin/ directory + +* Fri Nov 18 2016 Peter Robinson 2.2.2-2 +- Build QT GUI with qt5 (rhbz #1347752) + +* Fri Nov 18 2016 Peter Robinson 2.2.2-1 +- Version 2.2.2 +- See https://www.wireshark.org/docs/relnotes/wireshark-2.2.2.html +- Use %%license, spec cleanups +- Put udev rules in right location (rhbz #1365581) + +* Wed Nov 2 2016 Peter Lemenkov - 2.1.1-3 +- No longer uses adns ( https://github.com/wireshark/wireshark/commit/7a1d3f6 ) +- Remove --with-ipv6 switch ( https://github.com/wireshark/wireshark/commit/fad1565 ) +- Change GTK option switch ( https://github.com/wireshark/wireshark/commit/d77029d ) + +* Tue Sep 13 2016 Kevin Fenzi - 2.1.1-2 +- Add Requires(post) for systemd-udev to avoid rpm scriptlet failures + +* Sun Jul 24 2016 Peter Hatina - 2.1.1-1 +- Ver. 2.1.1 +- See https://www.wireshark.org/docs/relnotes/wireshark-2.1.1.html + +* Tue Jul 19 2016 Fedora Release Engineering - 2.1.0-4 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Wed Jul 13 2016 Peter Hatina - 2.1.0-3 +- Fix typo, install ws_diag_control +- Related: rhbz#1347869 + +* Mon Jun 20 2016 Peter Hatina - 2.1.0-2 +- Install ws_diag_control.h into standard include directory +- Resolves: rhbz#1347869 + +* Tue Jun 14 2016 Peter Hatina - 2.1.0-1 +- Ver. 2.1.0 +- See https://www.wireshark.org/docs/relnotes/wireshark-2.1.0.html + +* Thu Apr 28 2016 Peter Hatina - 2.0.3-1 +- Ver. 2.0.3 + +* Tue Mar 01 2016 Peter Hatina - 2.0.2-1 +- Ver. 2.0.2 + +* Tue Feb 23 2016 Peter Hatina - 2.0.1-3 +- Fix missing Requires in wireshark.pc + +* Fri Feb 05 2016 Fedora Release Engineering - 2.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jan 14 2016 Peter Hatina - 2.0.1-1 +- Ver. 2.0.1 +- Introduced wireshark metapackage for wireshark-cli and wireshark-gtk +- wireshark-qt and wireshark-gtk contain the GUI applications +- See https://www.wireshark.org/docs/relnotes/wireshark-2.0.1.html + +* Fri Jan 8 2016 Peter Lemenkov - 1.12.9-1 +- Ver. 1.12.9 +- See https://www.wireshark.org/docs/relnotes/wireshark-1.12.9.html + +* Tue Nov 3 2015 Peter Lemenkov - 1.12.8-2 +- Fixed Wireshark detection in external projects using wireshark.m4 script. + See https://bugzilla.redhat.com/1274831 for further details. + +* Thu Oct 15 2015 Peter Hatina - 1.12.8-1 +- Ver. 1.12.8 +- Dropped patch no. 10 (applied upstream) + +* Fri Aug 21 2015 Peter Lemenkov - 1.12.7-2 +- Enable libnl3 (see rhbz#1207386, rhbz#1247566) +- Remove airpcap switch (doesn't have any effect on Linux) +- Backport patch no. 11 +- Fixed building with F24+ + +* Tue Aug 18 2015 Peter Lemenkov - 1.12.7-1 +- Ver. 1.12.7 +- Dropped patch no. 11 (applied upstream) + +* Tue Jun 30 2015 Peter Hatina - 1.12.6-4 +- Move plugins to %%{_libdir}/wireshark/plugins to avoid + transaction conflicts + +* Fri Jun 26 2015 Peter Hatina - 1.12.6-3 +- Disable overlay scrolling in main window +- Resolves: rhbz#1235830 + +* Fri Jun 26 2015 Peter Hatina - 1.12.6-2 +- Add symlink plugins/current -> plugins/%%{version} + +* Thu Jun 18 2015 Peter Hatina - 1.12.6-1 +- Ver. 1.12.6 + +* Wed May 13 2015 Peter Hatina - 1.12.5-1 +- Ver. 1.12.5 + +* Thu Mar 26 2015 Richard Hughes - 1.12.4-2 +- Add an AppData file for the software center + +* Thu Mar 5 2015 Peter Hatina - 1.12.4-1 +- Ver. 1.12.4 + +* Mon Feb 2 2015 Peter Hatina - 1.12.3-3 +- temporary: disable lua + +* Mon Feb 2 2015 Peter Hatina - 1.12.3-2 +- rebuild with gtk3 +- fix gdk crash + +* Thu Jan 8 2015 Peter Hatina - 1.12.3-1 +- Ver. 1.12.3 + +* Mon Dec 22 2014 Peter Hatina - 1.12.2-2 +- fix CLI parsing by getopt_long + +* Mon Nov 17 2014 Peter Hatina - 1.12.2-1 +- Ver. 1.12.2 + +* Mon Sep 22 2014 Peter Hatina - 1.12.1-1 +- Ver. 1.12.1 + +* Tue Sep 09 2014 Peter Lemenkov - 1.12.0-5 +- Install epan/wmem/*.h files. See rhbz #1129419 + +* Wed Sep 3 2014 Peter Hatina - 1.12.0-4 +- fix fields print format + +* Mon Aug 18 2014 Rex Dieter 1.12.0-3 +- update mime scriptlets + +* Mon Aug 18 2014 Fedora Release Engineering - 1.12.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Tue Aug 05 2014 Peter Lemenkov - 1.12.0-1 +- Ver. 1.12.0 +- Dropped a lot of outdated patches. +- Added /usr/sbin/captype application. +- Added temporary workaround for wireshark.pc.in missing in the official + tarball. +- Removed outdated --with-dumpcap-group="wireshark" cli switch. It doesn't work + during rpmbuild, and we still set group explicitly in the 'files' section. +- Removed --enable-setcap-install. Likewise. +- Some ANSI C header files were moved to epan/ + +* Fri Aug 1 2014 Peter Hatina - 1.10.9-1 +- Ver. 1.10.9 + +* Fri Jun 13 2014 Peter Hatina - 1.10.8-1 +- Ver. 1.10.8 + +* Sun Jun 08 2014 Fedora Release Engineering - 1.10.7-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Fri May 30 2014 Peter Hatina - 1.0.7-2 +- add AMQP 1.0 support + +* Wed Apr 23 2014 Peter Hatina - 1.10.7-1 +- Ver. 1.10.7 + +* Fri Mar 21 2014 Peter Hatina - 1.10.6-2 +- Reload udev rule for usbmon subsystem only + +* Sat Mar 08 2014 Peter Lemenkov - 1.10.6-1 +- Ver. 1.10.6 + +* Fri Mar 7 2014 Peter Hatina - 1.10.5-4 +- Fix Capture Dialog layout on low resolution displays +- Resolves: #1071313 + +* Sun Feb 9 2014 Ville Skyttä +- Fix --with-gtk* build option usage. + +* Wed Jan 29 2014 Peter Lemenkov - 1.10.5-3 +- Fixed paths in the desktop-file (see rhbz #1059188) + +* Mon Jan 13 2014 Peter Lemenkov - 1.10.5-2 +- Updated RTPproxy dissector (again) +- Fix rare issue with the Sniffer traces (patch no. 23) + +* Mon Dec 23 2013 Peter Lemenkov - 1.10.5-1 +- Ver. 1.10.5 +- Don't apply upstreamed patches no. 18, 19, 20. + +* Thu Dec 19 2013 Peter Lemenkov - 1.10.4-2 +- Fix endianness in the Bitcoin protocol dissector (patch no. 19) +- Last-minute fix for wrongly backported change (patch no. 20) +- Fix FTBFS in Rawhide (see patch no. 21 - recent Glib doesn't provide g_memmove macro anymore) + +* Wed Dec 18 2013 Peter Lemenkov - 1.10.4-1 +- Ver. 1.10.4 +- Don't apply upsteamed patches no. 13, 14, 15, 16, 17 +- Fix variable overflow (patch no. 18) +- Updated RTPproxy dissector (backported three more patches from trunk) + +* Tue Dec 10 2013 Peter Hatina - 1.10-3-9 +- remove python support + +* Tue Dec 10 2013 Peter Hatina - 1.10-3-8 +- fix read permissions of /dev/usbmon* for non-root users + +* Mon Dec 09 2013 Peter Lemenkov - 1.10.3-7 +- Fix error in the backported RTPproxy patches + +* Fri Dec 06 2013 Peter Lemenkov - 1.10.3-6 +- Updated RTPproxy dissector (again), squashed patch no. 15 (applied upstream). +- Use proper soname in the python scripts +- Don't apply no longer needed fix for pod2man. +- Fix for main window. See patch no. 15 +- Fix for SCTP dissection. See patch no. 16 +- Fix for rare issue in Base Station Subsystem GPRS Protocol dissection. See + patch no. 17 +- Fix building w/o Lua + +* Wed Nov 27 2013 Peter Lemenkov - 1.10.3-5 +- Updated RTPproxy dissector (again) +- Allow packets more than 64k (for USB capture). See patch no. 13 +- Don't die during loading of some SIP capture files. See patch no. 14 +- Backport support for RTPproxy dissector timeouts detection. See patch no. 15 + +* Wed Nov 13 2013 Peter Lemenkov - 1.10.3-4 +- Updated RTPproxy dissector + +* Thu Nov 07 2013 Peter Hatina - 1.10.3-3 +- fix subpackage requires + +* Wed Nov 06 2013 Peter Hatina - 1.10.3-2 +- harden dumpcap capabilities + +* Sat Nov 02 2013 Peter Lemenkov - 1.10.3-1 +- Ver. 1.10.3 +- Dropped upsteamed patch no. 13 + +* Tue Oct 01 2013 Peter Lemenkov - 1.10.2-8 +- Added support for rtpproxy conversations (req/resp matching) + +* Tue Sep 24 2013 Peter Hatina - 1.10.2-7 +- fix build error caused by symbols clash + +* Tue Sep 17 2013 Peter Hatina - 1.10.2-6 +- move default temporary directory to /var/tmp + +* Fri Sep 13 2013 Peter Lemenkov - 1.10.2-5 +- Convert automake/pkgconfig files into patches (better upstream integration) +- Restored category in the *.desktop file +- Install another one necessary header file - frame_data_sequence.h + +* Thu Sep 12 2013 Peter Lemenkov - 1.10.2-4 +- Enhance desktop integration (*.desktop and MIME-related files) + +* Thu Sep 12 2013 Peter Lemenkov - 1.10.2-3 +- Fix building on Fedora 18 (no perl-podlators) + +* Thu Sep 12 2013 Peter Lemenkov - 1.10.2-2 +- Add an OpenFlow dissector + +* Wed Sep 11 2013 Peter Lemenkov - 1.10-2-1 +- Ver. 1.10.2 +- Actually remove the console helper + +* Mon Sep 09 2013 Peter Lemenkov - 1.10.1-1 +- Ver. 1.10.1 +- Backported rtpproxy dissector module + +* Wed Sep 04 2013 Peter Hatina - 1.10.0-11 +- fix missing ws_symbol_export.h + +* Wed Sep 04 2013 Peter Hatina - 1.10.0-10 +- fix tap iostat overflow + +* Wed Sep 04 2013 Peter Hatina - 1.10.0-9 +- fix sctp bytes graph crash + +* Wed Sep 04 2013 Peter Hatina - 1.10.0-8 +- fix string overrun in plugins/profinet + +* Tue Sep 03 2013 Peter Hatina - 1.10.0-7 +- fix BuildRequires - libgcrypt-devel + +* Tue Sep 03 2013 Peter Hatina - 1.10.0-6 +- fix build parameter -fstack-protector-all + +* Sun Aug 04 2013 Fedora Release Engineering - 1.10.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon Jun 24 2013 Peter Hatina 1.10.0-4 +- fix pod2man build error + +* Mon Jun 24 2013 Peter Hatina 1.10.0-3 +- fix bogus date + +* Mon Jun 17 2013 Peter Hatina 1.10.0-2 +- fix flow graph crash + +* Mon Jun 17 2013 Peter Hatina 1.10.0-1 +- upgrade to 1.10.0 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.10.0.html + +* Mon Apr 08 2013 Peter Hatina 1.8.6-5 +- fix documentation build error + +* Wed Mar 27 2013 Peter Hatina 1.8.6-4 +- fix capture crash (#894753) + +* Tue Mar 19 2013 Peter Hatina 1.8.6-3 +- fix dns resolving crash (#908211) + +* Mon Mar 18 2013 Peter Hatina 1.8.6-2 +- return to gtk2, stable branch 1.8 is not gtk3 ready + +* Tue Mar 12 2013 Peter Hatina 1.8.6-1 +- upgrade to 1.8.6 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.8.6.html + +* Sun Feb 10 2013 Parag Nemade - 1.8.5-3 +- Remove vendor tag from desktop file as per https://fedorahosted.org/fesco/ticket/1077 + +* Tue Feb 05 2013 Peter Hatina - 1.8.5-2 +- fix gtk3 layout issues +- NOTE: there may be some windows with broken layouts left + +* Thu Jan 31 2013 Peter Hatina - 1.8.5-1 +- upgrade to 1.8.5 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.8.5.html + +* Mon Dec 03 2012 Peter Hatina - 1.8.4-1 +- upgrade to 1.8.4 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.8.4.html + +* Tue Oct 16 2012 Peter Hatina - 1.8.3-2 +- backport dissector table fix +- TODO: remove this after new release + +* Thu Oct 11 2012 Peter Hatina - 1.8.3-1 +- upgrade to 1.8.3 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.8.3.html + +* Tue Sep 4 2012 Jan Safranek - 1.8.2-3 +- added back compatibility with RHEL6 +- GeoIP build dependency made also conditional on with_GeoIP variable + +* Wed Aug 29 2012 Jan Safranek - 1.8.2-2 +- fixed "libwireshark.so.1: cannot open shared object file" error + message on startup + +* Thu Aug 16 2012 Jan Safranek - 1.8.2-1 +- upgrade to 1.8.2 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.8.2.html + +* Fri Jul 27 2012 Fedora Release Engineering - 1.8.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Jul 24 2012 Jan Safranek - 1.8.1-1 +- upgrade to 1.8.1 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.8.1.html + +* Mon Jun 25 2012 Jan Safranek - 1.8.0 +- upgrade to 1.8.0 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.8.0.html + +* Wed May 23 2012 Jan Safranek - 1.6.8-1 +- upgrade to 1.6.8 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.6.8.html + +* Mon May 21 2012 Jan Safranek - 1.6.7-2 +- Removed dependency on GeoIP on RHEL. + +* Tue Apr 10 2012 Jan Safranek - 1.6.7-1 +- upgrade to 1.6.7 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.6.7.html + +* Wed Mar 28 2012 Jan Safranek - 1.6.6-1 +- upgrade to 1.6.6 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.6.6.html + +* Fri Mar 9 2012 Jan Safranek - 1.6.5-2 +- fixed wireshark crashing when using combo box in import dialog (#773290) +- added AES support into netlogon dissector + +* Wed Jan 11 2012 Jan Safranek - 1.6.5-1 +- upgrade to 1.6.5 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.6.5.html + +* Fri Dec 2 2011 Jan Safranek - 1.6.4-1 +- upgrade to 1.6.4 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.6.4.html +- build with c-ares and libpcap (#759305) +- fixed display of error message boxes on startup in gnome3 (#752559) + +* Mon Nov 14 2011 Jan Safranek - 1.6.3-2 +- added dependency on shadow-utils (#753293) +- removed usermode support + +* Wed Nov 2 2011 Jan Safranek - 1.6.3-1 +- upgrade to 1.6.3 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.6.3.html + +* Wed Oct 26 2011 Fedora Release Engineering - 1.6.2-5 +- Rebuilt for glibc bug#747377 + +* Fri Oct 21 2011 Jan Safranek - 1.6.2-4 +- updated autoconf macros and pkgconfig file in wireshark-devel to reflect + current config.h (#746655) + +* Mon Oct 17 2011 Steve Dickson - 1.6.2-3 +- Fixed a regression introduce by upstream patch r38306 + which caused v4.1 traffic not to be displayed. +- Added v4 error status to packet detail window. + +* Tue Sep 13 2011 Jan Safranek - 1.6.2-2 +- fixed spelling of the security message (#737270) + +* Fri Sep 9 2011 Jan Safranek - 1.6.2-1 +- upgrade to 1.6.2 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.6.2.html + + +* Thu Jul 21 2011 Jan Safranek - 1.6.1-1 +- upgrade to 1.6.1 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.6.1.html + +* Thu Jun 16 2011 Jan Safranek - 1.6.0-4 +- fixed previous incomplete fix + +* Thu Jun 16 2011 Jan Safranek - 1.6.0-3 +- fixed Fedora-specific message when user is not part of 'wireshark' group + - now it does not contain '<' and '>' characters (#713545) + +* Thu Jun 9 2011 Jan Safranek - 1.6.0-2 +- added wspy_dissectors directory to the package + - other packages can add Python plugins there + - as side effect, removed following message: + [Errno 2] No such file or directory: '/usr/lib64/wireshark/python/1.6.0/wspy_dissectors' +- enabled zlib support + +* Wed Jun 8 2011 Jan Safranek - 1.6.0-1 +- upgrade to 1.6.0 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.6.0.html + +* Thu Jun 2 2011 Jan Safranek - 1.4.7-1 +- upgrade to 1.4.7 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.4.7.html + +* Thu May 19 2011 Steve Dickson - 1.4.6-3 +- Improved the NFS4.1 patcket dissectors + +* Sat May 07 2011 Christopher Aillon - 1.4.6-2 +- Update icon cache scriptlet + +* Tue Apr 19 2011 Jan Safranek - 1.4.6-1 +- upgrade to 1.4.6 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.4.6.html + +* Mon Apr 18 2011 Jan Safranek - 1.4.5-1 +- upgrade to 1.4.5 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.4.5.html + +* Sun Apr 03 2011 Cosimo Cecchi - 1.4.4-2 +- Use hi-res icons + +* Thu Mar 3 2011 Jan Safranek - 1.4.4-1 +- upgrade to 1.4.4 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.4.4.html + +* Mon Feb 07 2011 Fedora Release Engineering - 1.4.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Jan 17 2011 Jan Safranek - 1.4.3-2 +- create the 'wireshark' group as system, not user +- add few additional header files to -devel subpackage (#671997) + +* Thu Jan 13 2011 Jan Safranek - 1.4.3-1 +- upgrade to 1.4.3 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.4.3.html + +* Wed Jan 5 2011 Jan Safranek - 1.4.2-5 +- fixed buffer overflow in ENTTEC dissector (#666897) + +* Wed Dec 15 2010 Jan Safranek - 1.4.2-4 +- added epan/dissectors/*.h to -devel subpackage (#662969) + +* Mon Dec 6 2010 Jan Safranek - 1.4.2-3 +- fixed generation of man pages again (#635878) + +* Fri Nov 26 2010 Jan Safranek - 1.4.2-2 +- rework the Wireshark security (#657490). Remove the console helper and + allow only members of new 'wireshark' group to capture the packets. + +* Mon Nov 22 2010 Jan Safranek - 1.4.2-1 +- upgrade to 1.4.2 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.4.2.html + +* Mon Nov 1 2010 Jan Safranek - 1.4.1-2 +- temporarily disable zlib until + https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4955 is resolved (#643461) + +* Fri Oct 22 2010 Jan Safranek - 1.4.1-1 +- upgrade to 1.4.1 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.4.1.html +- Own the %%{_libdir}/wireshark dir (#644508) +- associate *.pcap files with wireshark (#641163) + +* Wed Sep 29 2010 jkeating - 1.4.0-2 +- Rebuilt for gcc bug 634757 + +* Fri Sep 24 2010 Jan Safranek - 1.4.0-2 +- fixed generation of man pages (#635878) + +* Tue Aug 31 2010 Jan Safranek - 1.4.0-1 +- upgrade to 1.4.0 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.4.0.html + +* Fri Jul 30 2010 Jan Safranek - 1.2.10-1 +- upgrade to 1.2.10 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.2.10.html + +* Fri Jul 30 2010 Jan Safranek - 1.2.9-4 +- Rebuilt again for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + +* Thu Jul 22 2010 Jan Safranek - 1.2.9-3 +- removing useless LDFLAGS (#603224) + +* Thu Jul 22 2010 David Malcolm - 1.2.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + +* Fri Jun 11 2010 Radek Vokal - 1.2.9-1 +- upgrade to 1.2.9 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.2.9.html + +* Mon May 17 2010 Radek Vokal - 1.2.8-4 +- removing traling bracket from python_sitearch (#592391) + +* Fri May 7 2010 Radek Vokal - 1.2.8-3 +- fix patched applied without fuzz=0 + +* Thu May 6 2010 Radek Vokal - 1.2.8-2 +- use sitearch instead of sitelib to avoid pyo and pyc conflicts + +* Thu May 6 2010 Radek Vokal - 1.2.8-1 +- upgrade to 1.2.8 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.2.8.html + +* Tue Apr 6 2010 Radek Vokal - 1.2.7-2 +- rebuild with GeoIP support (needs to be turned on in IP protocol preferences) + +* Fri Apr 2 2010 Radek Vokal - 1.2.7-1 +- upgrade to 1.2.7 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.2.7.html + +* Wed Mar 24 2010 Radek Vokal - 1.2.6-3 +- bring back -pie + +* Tue Mar 16 2010 Jeff Layton - 1.2.6-2 +- add patch to allow decode of NFSv4.0 callback channel +- add patch to allow decode of more SMB FIND_FILE infolevels + +* Fri Jan 29 2010 Radek Vokal - 1.2.6-1 +- upgrade to 1.2.6 +- see https://www.wireshark.org/docs/relnotes/wireshark-1.2.6.html + +* Wed Jan 20 2010 Radek Vokal - 1.2.5-5 +- minor spec file tweaks for better svn checkout support (#553500) + +* Tue Jan 05 2010 Radek Vokál - 1.2.5-4 +- init.lua is present always and not only when lua support is enabled + +* Tue Jan 05 2010 Radek Vokál - 1.2.5-3 +- fix file list, init.lua is only in -devel subpackage (#552406) + +* Fri Dec 18 2009 Patrick Monnerat 1.2.5-2 +- Autoconf macro for plugin development. + +* Fri Dec 18 2009 Radek Vokal - 1.2.5-1 +- upgrade to 1.2.5 +- fixes security vulnaribilities, see https://www.wireshark.org/security/wnpa-sec-2009-09.html + +* Thu Dec 17 2009 Radek Vokal - 1.2.4-3 +- split -devel package (#547899, #203642, #218451) +- removing root warning dialog (#543709) + +* Mon Dec 14 2009 Radek Vokal - 1.2.4-2 +- enable lua support - https://wiki.wireshark.org/Lua +- attempt to fix filter crash on 64bits + +* Wed Nov 18 2009 Radek Vokal - 1.2.4-1 +- upgrade to 1.2.4 +- https://www.wireshark.org/docs/relnotes/wireshark-1.2.4.html + +* Fri Oct 30 2009 Radek Vokal - 1.2.3-1 +- upgrade to 1.2.3 +- https://www.wireshark.org/docs/relnotes/wireshark-1.2.3.html + +* Mon Sep 21 2009 Radek Vokal - 1.2.2-1 +- upgrade to 1.2.2 +- https://www.wireshark.org/docs/relnotes/wireshark-1.2.2.html + +* Mon Sep 14 2009 Bill Nottingham - 1.2.1-5 +- do not use portaudio in RHEL + +* Fri Aug 28 2009 Radek Vokal - 1.2.1-4 +- yet anohter rebuilt + +* Fri Aug 21 2009 Tomas Mraz - 1.2.1-3 +- rebuilt with new openssl + +* Mon Jul 27 2009 Fedora Release Engineering - 1.2.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Jul 22 2009 Radek Vokal - 1.2.1 +- upgrade to 1.2.1 +- https://www.wireshark.org/docs/relnotes/wireshark-1.2.1.html + +* Tue Jun 16 2009 Radek Vokal - 1.2.0 +- upgrade to 1.2.0 +- https://www.wireshark.org/docs/relnotes/wireshark-1.2.0.html + +* Fri May 22 2009 Radek Vokal - 1.1.4-0.pre1 +- update to latest development build + +* Thu Mar 26 2009 Radek Vokal - 1.1.3-1 +- upgrade to 1.1.3 + +* Thu Mar 26 2009 Radek Vokal - 1.1.2-4.pre1 +- fix libsmi support + +* Wed Feb 25 2009 Fedora Release Engineering - 1.1.2-3.pre1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Feb 16 2009 Radek Vokal - 1.1.2-2.pre1 +- add netdump support + +* Sun Feb 15 2009 Steve Dickson - 1.1.2-1.pre1 +- NFSv4.1: Add support for backchannel decoding + +* Mon Jan 19 2009 Radek Vokal - 1.1.2-0.pre1 +- upgrade to latest development release +- added support for portaudio (#480195) + +* Sun Jan 18 2009 Tomas Mraz - 1.1.1-0.pre1.2 +- rebuild with new openssl + +* Sat Nov 29 2008 Ignacio Vazquez-Abrams - 1.1.1-0.pre1.1 +- Rebuild for Python 2.6 + +* Thu Nov 13 2008 Radek Vokál 1.1.1-0.pre1 +- upgrade to 1.1.1 development branch + +* Wed Sep 10 2008 Radek Vokál 1.0.3-1 +- upgrade to 1.0.3 +- Security-related bugs in the NCP dissector, zlib compression code, and Tektronix .rf5 file parser have been fixed. +- WPA group key decryption is now supported. +- A bug that could cause packets to be wrongly dissected as "Redback Lawful Intercept" has been fixed. + +* Mon Aug 25 2008 Radek Vokál 1.0.2-3 +- fix requires for wireshark-gnome + +* Thu Jul 17 2008 Steve Dickson 1.0.2-2 +- Added patches to support NFSv4.1 + +* Fri Jul 11 2008 Radek Vokál 1.0.2-1 +- upgrade to 1.0.2 + +* Tue Jul 8 2008 Radek Vokál 1.0.1-1 +- upgrade to 1.0.1 + +* Sun Jun 29 2008 Dennis Gilmore 1.0.0-3 +- add sparc arches to -fPIE +- rebuild for new gnutls + +* Tue Apr 1 2008 Radek Vokál 1.0.0-2 +- fix BuildRequires - python, yacc, bison + +* Tue Apr 1 2008 Radek Vokál 1.0.0-1 +- April Fools' day upgrade to 1.0.0 + +* Tue Feb 19 2008 Fedora Release Engineering - 0.99.7-3 +- Autorebuild for GCC 4.3 + +* Wed Dec 19 2007 Radek Vokál 0.99.7-2 +- fix crash in unprivileged mode (#317681) + +* Tue Dec 18 2007 Radek Vokál 0.99.7-1 +- upgrade to 0.99.7 + +* Fri Dec 7 2007 Radek Vokál 0.99.7-0.pre2.1 +- rebuilt for openssl + +* Mon Nov 26 2007 Radek Vokal 0.99.7-0.pre2 +- switch to libsmi from net-snmp +- disable ADNS due to its lack of Ipv6 support +- 0.99.7 prerelease 2 + +* Tue Nov 20 2007 Radek Vokal 0.99.7-0.pre1 +- upgrade to 0.99.7 pre-release + +* Wed Sep 19 2007 Radek Vokál 0.99.6-3 +- fixed URL + +* Thu Aug 23 2007 Radek Vokál 0.99.6-2 +- rebuilt + +* Mon Jul 9 2007 Radek Vokal 0.99.6-1 +- upgrade to 0.99.6 final + +* Fri Jun 15 2007 Radek Vokál 0.99.6-0.pre2 +- another pre-release +- turn on ADNS support + +* Wed May 23 2007 Radek Vokál 0.99.6-0.pre1 +- update to pre1 of 0.99.6 release + +* Mon Feb 5 2007 Radek Vokál 0.99.5-1 +- multiple security issues fixed (#227140) +- CVE-2007-0459 - The TCP dissector could hang or crash while reassembling HTTP packets +- CVE-2007-0459 - The HTTP dissector could crash. +- CVE-2007-0457 - On some systems, the IEEE 802.11 dissector could crash. +- CVE-2007-0456 - On some systems, the LLT dissector could crash. + +* Mon Jan 15 2007 Radek Vokal 0.99.5-0.pre2 +- another 0.99.5 prerelease, fix build bug and pie flags + +* Tue Dec 12 2006 Radek Vokal 0.99.5-0.pre1 +- update to 0.99.5 prerelease + +* Thu Dec 7 2006 Jeremy Katz - 0.99.4-5 +- rebuild for python 2.5 + +* Tue Nov 28 2006 Radek Vokal 0.99.4-4 +- rebuilt for new libpcap and net-snmp + +* Thu Nov 23 2006 Radek Vokal 0.99.4-3 +- add htmlview to Buildrequires to be picked up by configure scripts (#216918) + +* Tue Nov 7 2006 Radek Vokal 0.99.4-2.fc7 +- Requires: net-snmp for the list of MIB modules + +* Wed Nov 1 2006 Radek Vokál 0.99.4-1 +- upgrade to 0.99.4 final + +* Tue Oct 31 2006 Radek Vokál 0.99.4-0.pre2 +- upgrade to 0.99.4pre2 + +* Tue Oct 10 2006 Radek Vokal 0.99.4-0.pre1 +- upgrade to 0.99.4-0.pre1 + +* Fri Aug 25 2006 Radek Vokál 0.99.3-1 +- upgrade to 0.99.3 +- Wireshark 0.99.3 fixes the following vulnerabilities: +- the SCSI dissector could crash. Versions affected: CVE-2006-4330 +- the IPsec ESP preference parser was susceptible to off-by-one errors. CVE-2006-4331 +- a malformed packet could make the Q.2931 dissector use up available memory. CVE-2006-4333 + +* Tue Jul 18 2006 Radek Vokál 0.99.2-1 +- upgrade to 0.99.2 + +* Wed Jul 12 2006 Jesse Keating - 0.99.2-0.pre1.1 +- rebuild + +* Tue Jul 11 2006 Radek Vokál 0.99.2-0.pre1 +- upgrade to 0.99.2pre1, fixes (#198242) + +* Tue Jun 13 2006 Radek Vokal 0.99.1-0.pre1 +- spec file changes + +* Fri Jun 9 2006 Radek Vokal 0.99.1pre1-1 +- initial build for Fedora Core