Commit Graph

52615 Commits

Author SHA1 Message Date
Alexis La Goutte 7a68dc5bfd Fix packet-ospf.c:1181:33: warning: code will never be executed [-Wunreachable-code] found by Clang with extra compiler flags
Change-Id: I6a923d85cb5cc947a7e96c1845bde72059d92118
Reviewed-on: https://code.wireshark.org/review/1322
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-24 07:30:56 +00:00
Alexis La Goutte 75f4f9dc92 Fix packet-netlink-sock_diag.c:653:4: warning: code will never be executed [-Wunreachable-code] found by Clang with extra compiler flags
Change-Id: Ie3917cee669cfe71f0967e132dd73145a55f0aad
Reviewed-on: https://code.wireshark.org/review/1321
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-24 07:29:51 +00:00
Alexis La Goutte e45af4112f Fix packet-ospf.c:1181:33: warning: code will never be executed [-Wunreachable-code] found by Clang with extra compiler flags
Change-Id: Ia08e01eee4b0829074f65d50c6ba51ef32dc64b9
Reviewed-on: https://code.wireshark.org/review/1320
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-24 07:29:13 +00:00
Alexis La Goutte 50ed98ea33 Fix warning: extra ‘;’ [-Wpedantic]
Change-Id: Ib2f52d28dce0f64bf56ff0df7b4ed7d091670620
Reviewed-on: https://code.wireshark.org/review/1319
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-24 06:48:56 +00:00
Alexis La Goutte bf2d8f96da Fix Warning: Found soft-deprecated APIs in epan/dissectors/packet-lisp.c: tvb_length
and also fix warning found by fix-encodings-args

Change-Id: I20193d9f2700e8ede439dcc848390ff7672239b3
Reviewed-on: https://code.wireshark.org/review/1318
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-24 06:48:35 +00:00
Jakub Zawadzki 993adc84d5 Fix counting/ checking for leap years in mktime_utc()
When HAVE_TIMEGM is undefined mktime_utc() might output one day shift (+86400s)
for (years <= 1967 or years >= 2100) && month >= 3

{ .tm_mday = 1 .tm_mon = 2 .tm_year = 67 }
mktime_utc() = -89436590    // Thu Mar  2 00:00:00 UTC 1967
    gmtime() = -89596800    // Wed Mar  1 00:00:00 UTC 1967

{ .tm_mday = 1 .tm_mon = 2 .tm_year = 200 }
mktime_utc() = 4107628800   // Tue Mar  2 00:00:00 UTC 2100
    gmtime() = 4107542400   // Mon Mar  1 00:00:00 UTC 2100

Change-Id: I1a544762fa5178c8798496d7dc30a2e767919149
Reviewed-on: https://code.wireshark.org/review/1287
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-24 06:02:48 +00:00
Lorand Jakab 8759da846f Improve LCAF handling
Also, remove some more proto_tree_add_text() occurrences.

Change-Id: Ie46e16308b95f190229c22d06c5235ea3464394a
Signed-off-by: Lorand Jakab <ljakab@ac.upc.edu>
Reviewed-on: https://code.wireshark.org/review/1317
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-24 05:57:16 +00:00
Evan Huus bf1f30b63a JXTA: ask for one more segment, not one more byte
Otherwise we end up doing reassembly of long messages one painful byte at a time
even when all of those bytes are in the same TCP payload. This results in
ridiculous memory usage.

Change-Id: Ie28d5ade1fec54e6ebc225341582270651d7371c
Closes-Bug: 10018
Reviewed-on: https://code.wireshark.org/review/1312
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-24 02:16:46 +00:00
Evan Huus fbc522633e Revert "Move kerberos to dirty list in CMake"
it no longer has any warnings

This reverts commit 30c9f421c0.

Change-Id: I5cc71f905ffa4f00ffb44ad7d03b2684c2e44e38
Reviewed-on: https://code.wireshark.org/review/1316
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-24 02:16:37 +00:00
Evan Huus 3b328853ef Revert "Move kerberos to dirty dissector list"
it no longer has any warnings

This reverts commit 3ff57c86ad.

Change-Id: I655f4cf682eb6784340799c54d2f9a6cc5321812
Reviewed-on: https://code.wireshark.org/review/1315
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-24 02:16:22 +00:00
Pascal Quantin 853e391dfa Kerberos: use dissect_kerberos_ADDR_TYPE (removes an unused function warning)
Change-Id: I87d9c88d9db06c8f7dedd6e39152c39c13f8d32d
Reviewed-on: https://code.wireshark.org/review/1314
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-23 22:12:35 +00:00
Alexis La Goutte 5ab53e6079 Fix typo in comment (parameterts => parameter)
Change-Id: Ie1fefc27d249929f0f5108b0757768e7e23a9dbe
Reviewed-on: https://code.wireshark.org/review/1310
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-23 21:34:45 +00:00
Stig Bjørlykke 4eb4bae413 Add check for no kerberos keytab file.
Avoid printf warnings when loading a capture with kerberos packets
when not having configured a keytab file.

Change-Id: I0950daa18c42f4687d29101fac74f6f6bd6071b1
Reviewed-on: https://code.wireshark.org/review/1300
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-23 19:28:24 +00:00
Evan Huus 30c9f421c0 Move kerberos to dirty list in CMake
As pointed out by David Ameiss, I only did automake the first time round.

Change-Id: Ie72ab5014d8f21d194d15af430c6c0a8a612f5f7
Reviewed-on: https://code.wireshark.org/review/1309
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-23 19:20:14 +00:00
Evan Huus f62e8a090c Fix format warning.
Change-Id: I6627af8d90299d599db779bde0061191fc514fb3
Reviewed-on: https://code.wireshark.org/review/1307
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-23 17:53:52 +00:00
Evan Huus 3ff57c86ad Move kerberos to dirty dissector list
It currently generates some unused functions.

Change-Id: I59e2ffefbf66975d35f2a89c2c49c3ab61f41a84
Reviewed-on: https://code.wireshark.org/review/1306
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-23 17:51:57 +00:00
Pascal Quantin cd4d4acdbc MBIM: fix dissection of GSM SMS messages
Change-Id: I07e753e50a42513daa704e56ee5c9b399a91fec9
Reviewed-on: https://code.wireshark.org/review/1305
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-23 17:45:25 +00:00
Bill Meier 3b6789ecbe packet-mqtt.c: Minor cleanup
- Create/use an extended value string;
- Use ...add_text() instead of ..._add_string() for a packet details "header" line
   (Removes a filter named "mqtt" (not the 'protocol' filter));
- Fix what is (IMO) a slightly misleading display of "Connect Flags";
- Remove two lines of duplicate code;
- Localize some variables;
- Remove some unneeded initializers;
- Set tab-stops, etc in editor mode-lines to 8;
- 'offset++' ==> 'offset += 1';
- Do some minor whitespace changes.

Change-Id: Ia891c6893643790dbb26510f060c4fb6dfe1fe3a
Reviewed-on: https://code.wireshark.org/review/1304
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-04-23 17:25:28 +00:00
Evan Huus fe195c0c97 Don't throw for offset at end of TVB with len -1.
g867a1827e7dc88896ee27a107eb35c4b3973d270 introduced a change to cleanup/fix
handling of bounds checks for -1 length fields, but it ended up guaranteeing a
throw for 0-length tvbs, which isn't good; we ought to be able to add 0-length
FT_PROTOCOL items at the very least.

Better names for the function than _cheat are welcome, but I want to shut up the
buildbot.

Change-Id: I24610f947d03dac32766e2a0ffa0ff7bcc74c3e8
Reviewed-on: https://code.wireshark.org/review/1303
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-23 15:57:13 +00:00
Michael Mann be13690c3c Continuation of bug 9532.
Ie4d1edfd67a8e6f02834573f29f07baf79058534 created a several duplicate hf_ registrations.  That led to the exposure of some other potential problems with generating sequences.

Still not quite complete, but want to pacify the buildbots, so there is a small amount of manual editing to comment out a few duplicated hfs in packet-parlay.c.

Change-Id: I0ff8a9795e213ab966db8d6333b9477bad06250b
Reviewed-on: https://code.wireshark.org/review/1302
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-23 15:47:33 +00:00
David Ameiss 1a1abf9523 Conversation/memory scope fixes for LBM dissectors. See bug 9718.
Change-Id: I58aa249d73ab44f5f56b1559b38b216cdb542ecb
Reviewed-on: https://code.wireshark.org/review/1280
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-23 15:22:53 +00:00
Pascal Quantin abbcaabccc Kerberos: use auto generated code for ADDR-TYPE instead of a hand made value_string array
Change-Id: I74089fe609368fdd582aef1f2cb00a3905e0641b
Reviewed-on: https://code.wireshark.org/review/1301
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-23 15:22:02 +00:00
Evan Huus cb8386c4de Revert "Create the HTTP tree after we're assured it's HTTP. Otherwise a bogus tree is created when HTTP2 traffic is found."
It causes the DTLS decryption test suite to fail for some reason, and I don't have time/energy to investigate further, so we should probably revert it until that gets resolved.

This reverts commit fc5d8db74d.

Change-Id: Iac9a7592047d2e080e380a70752efa076303e442
Reviewed-on: https://code.wireshark.org/review/1297
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-23 12:59:14 +00:00
Evan Huus f0e77aa366 Add a cast to satisfy mac buildbot.
Change-Id: I625b025d3f8a57812512497c6104977ae5d10232
Reviewed-on: https://code.wireshark.org/review/1298
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-23 12:58:53 +00:00
Evan Huus 9ba4c6e091 Hash map implementation for wmem.
This has two expected uses:
- Many current users of wmem_tree don't actually need the predecessor lookup
  it provides (the lookup_le function family). A hash map provides straight
  insertion and lookup much more efficiently than a wmem_tree when predecessor
  lookup isn't needed.

- Many current users of glib's hash table and hash functions use untrusted data
  for keys, making them vulnerable to algorithmic complexity attacks. Care has
  been taken to make this implementation secure against such attacks, so it
  should be used whenever data is untrusted.

In my benchmarks it is measurably slower than GHashTable, but not excessively
so. Given the additional security it provides this seems like a reasonable
trade-off (and it is still faster than a wmem_tree).

Change-Id: I2d67a0d06029f14c153eaa42d5cfc774aefd9918
Reviewed-on: https://code.wireshark.org/review/1272
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-23 12:42:26 +00:00
Roland Knall 268104a1dd CaptureDialog: Fix IF type for user created pipe
- If a user adds a pipe via "Capture Options"->"Manage Interfaces"
   ->"Pipes" the device.if_type.type is either not filled out (in
   the case if no other interfaces exist), or will be set to the
   last set if_type of the device queried by the iteration in line
   3537.

 - One could argue, that this is just a fixup, as still the issue
   remains, that the device structure will not be resetted, after
   the search for an already existing pipe element. Maybe a separate
   variable should be used for searching as it is used for adding
   the pipe

Change-Id: Ia727bf3ce270a62d065e8c524a13768af389c346
Reviewed-on: https://code.wireshark.org/review/1296
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-23 12:14:42 +00:00
Pascal Quantin 11b78ffbfa Kerberos: put PDU dissection under Kerberos tree and remove duplicate PDU name
Change-Id: Id4824ad3a7bca1959579e5fd0a17a67c6bcda174
Reviewed-on: https://code.wireshark.org/review/1293
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-23 08:03:57 +00:00
Lorand Jakab d41a6e4feb Fix LISP dissectior regressions introduced in 1.11
This patch fixes dissection of some fields and restores some of the
output before the dissector was updated not to use proto_tree_add_text()
calls.

While at it improve the consistency in the code.

Change-Id: Ic30e60de1382f4325bd75e814444205f2fc5a359
Signed-off-by: Lorand Jakab <ljakab@ac.upc.edu>
Reviewed-on: https://code.wireshark.org/review/1283
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-23 06:56:08 +00:00
Michael Mann fccf62ece2 Bugfix generating a sequence of "native" types. Bug 9532.
Previously a sequence of "native" types (int, float, etc) generated a proto_tree_add_uint (for the loop over the sequence) and a proto_tree_add_XXX (for the "native" type), but only 1 hf variable was created for the "loop" field, so DISSECTOR_ASSERT_NOT_REACHED would be generated if "native" type != uint.  Now a separate hf_ variable is generated for the "loop" and "native" type.

Also update existing IDL dissectors with new generator logic.

Change-Id: Ie4d1edfd67a8e6f02834573f29f07baf79058534
Reviewed-on: https://code.wireshark.org/review/1274
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-23 06:24:33 +00:00
Guy Harris 8ab1c804d7 Another cut-and-pasteo - UCS-4/UTF-32 should fetch 4-byte characters.
Change-Id: Iff4a659cb0d0062cc149f451e49474c8db4143cd
Reviewed-on: https://code.wireshark.org/review/1292
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-23 04:45:17 +00:00
Michael Mann 0f90397d29 Fix generator to remove Dead Store (Dead assignement/Dead increment) warning found by Clang.
(not sure why, but regeneration also "moved" some hf_ variables from previous version)

Change-Id: I197eacbb3f892dbdca6e6bc354fc88240c1bfb34
Reviewed-on: https://code.wireshark.org/review/1291
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-23 04:44:59 +00:00
Jeff Morriss 867a1827e7 Fix up get_hfi_length():
Treat FT_BYTES and a few others the same as FT_PROTOCOL: allow a zero length
but throw an exception if the offset is already beyond the end of the TVB
(prior to this change it would assert out).  This (when manually applied to
master-1.10) fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9999 .

While we're at it: tvb_captured_length_remaining() no longer returns -1 (see
r52571) so don't expect it to.  Instead just use
tvb_ensure_captured_length_remaining() to throw an exception if the offset is
bad.

Change-Id: I686722a4fed46b86139466afcf64ff02f319c702
Reviewed-on: https://code.wireshark.org/review/1289
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-23 04:41:11 +00:00
Jakub Zawadzki 9c8febde67 Fix copy & paste error in tvb_extract_utf_16_string, tvb_extract_ucs_4_string.
Use proper p{le,n}toh16 macro depending on endianess.

Change-Id: I8323e4296ec88e2cb24f54a1d8dc89328edb1957
Reviewed-on: https://code.wireshark.org/review/1285
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-23 04:33:44 +00:00
Pascal Quantin 490a8a6148 Kerberos: define HostAddress/addr-type as a FT_UINT32 field
Fixes part of bug 10019

Change-Id: Id367d6c86533c840ea2ff40ef96b1c1854b96150
Reviewed-on: https://code.wireshark.org/review/1288
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-22 22:08:30 +00:00
Peter Wu f746d5ec1d Fix ASAN error due to invalid type
ei_array is supposed to be an array of expert_entry items. However, it
was initialized of an array of expert_info_t items which is much larger.
This caused an ASAN error when running `tshark -z expert` because
expert_stat_packet wants to read past the stack.

Fix this by correcting the type. While at it, reduce the size of
expert_entry for 64-bit systems (reduces initial memory usage by 8
kilobytes) and avoid a redundant g_array_index call.

Change-Id: I2e08676a5e242743ed502dd2836806604ea75cc0
Reviewed-on: https://code.wireshark.org/review/1275
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-22 15:47:04 +00:00
Bill Meier 2d774c6f84 Minor cleanup
- Remove unneeded #includes;
- Move proto_reg_handoff...(() to the end of the file as per convention;
- Use dissector_add_handle() instead of using dissector_add_uint(..., 0, ...);
- #if 0 an unused global function (which caused a [-Wmissing-prototypes] warning);
- Remove an empty proto_reg-handoff...();
- 'if (already_registered)' not required in one case.

Change-Id: I74f267c2721df13eb4d52d7f19a6ded423218a39
Reviewed-on: https://code.wireshark.org/review/1277
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-04-22 15:00:57 +00:00
Bill Meier 085b37d9b6 Fix gcc "warning: no previous prototype ... [-Wmissing-prototypes]
Change-Id: Icdbc626dca876244b603c58cba05d0847d5d6a6f
Reviewed-on: https://code.wireshark.org/review/1276
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-22 14:57:50 +00:00
Michael Mann 66a430349f Cache the "tcp_tree" with p_add_proto_data. Bug 9518.
This is more reliable than doing "tree math" and corrects the intention of 5470356154 which made the incorrect assumption that tcp_dissect_pdus will be called with the tree that is passed into a protocol's main dissection function (directly from TCP).

Change-Id: I6ffc2188420ab74784c7bc2c69aa79ff071c90b6
Reviewed-on: https://code.wireshark.org/review/1214
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-22 13:45:35 +00:00
Alexis La Goutte 68eae53b0a Add Length for Mobility Header Link-Layer Address Option (Type 7)
Change-Id: I8e5a254d25a63c18753a2d6a4da4bfc470191304
Reviewed-on: https://code.wireshark.org/review/1204
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-22 08:45:10 +00:00
AndersBroman c0b7e19e1e Fix display of AVP: 3GPP-MS-TimeZone(23), oct is owerwritten.
Change-Id: I12caa4b612bb98459899054841317361bf4af215
Reviewed-on: https://code.wireshark.org/review/1273
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-22 08:38:49 +00:00
Alexis La Goutte 430457151a Manual fix of Dead Store (Dead assignement/Dead increment) warning found by Clang No found how to fix the generator...
Change-Id: Ic49e8904b44ff733cca0df916b6677e6fb86d9ba
Reviewed-on: https://code.wireshark.org/review/1209
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-22 07:08:54 +00:00
Evan Huus 1a6e9b5d70 Much faster implementation of 'strict' allocator.
Rather than using a hash table, which is overkill and slow, embed a
doubly-linked-list in the prefix structure.

On my tests with some random capture file and tshark -nxVr:
- normal block allocator: ~2.1 seconds
- old (slow) strict allocator: ~4.2 seconds
- new (fast) strict allocator: ~2.8 seconds

The buildbot will thank me :)

Change-Id: I2fb42229c4ee4c40bbe45ba04b7848792998eaa9
Reviewed-on: https://code.wireshark.org/review/1251
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-22 06:15:21 +00:00
Gerald Combs a755ccb9a0 Note the new transport name resolution behavior.
Change-Id: I345ca0770fe8c116c6103e09c70c46d7140b90e9
Reviewed-on: https://code.wireshark.org/review/1248
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-04-21 22:27:06 +00:00
Gerald Combs 4628dc0118 Disable transport name resolution by default.
Modern hosts typically open many more TCP and UDP connections than in
years past.  For an example opening a popular news site in a web browser
can easily trigger dozens of separate connections. At the same time our
services file has accumulated a lot of cruft over time. As a result
transport name resolution is a bunch of lies.

Change-Id: Ibbca5b1c7ea1e800fc46dad63b9270128dacd721
Reviewed-on: https://code.wireshark.org/review/1240
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-21 22:13:49 +00:00
Martin Kaiser b98e8eb326 regenerate manuf
Change-Id: Ib4cfdd8261e53caef695d54a2991223b1f296448
Reviewed-on: https://code.wireshark.org/review/1247
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-04-21 18:08:23 +00:00
Philip Rosenberg-Watt bf2b6dd2a0 Add short name for CableLabs.
Change-Id: I474c03a1a40586a14cdec2196ee3ebc89eedd8ab
Reviewed-on: https://code.wireshark.org/review/1236
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-04-21 18:06:50 +00:00
Bill Meier 72527a49b1 Define a function as 'static' (Fixes [-Wmissing-prototypes] warning).
Change-Id: Ia0a5c05c953053691837c5795c8204e2144d8067
Reviewed-on: https://code.wireshark.org/review/1241
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-04-21 18:04:11 +00:00
Martin Kaiser bcfa1cc974 dissect some more E-LMI fields
Change-Id: I9b0cb7c8602f813fd06f1b3ea6107ed6fe8d72ed
Reviewed-on: https://code.wireshark.org/review/1244
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-04-21 17:51:17 +00:00
Martin Kaiser 9c08f8db7c mention the E-LMI lua dissector in the header
Change-Id: I5e0e44019ddee4d39fbf2d6204c40c02d3e97c6f
Reviewed-on: https://code.wireshark.org/review/1243
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-04-21 17:51:01 +00:00
Martin Kaiser 4b754b77e7 add E-LMI to the release notes
Change-Id: I5e0e44018eaee4da9fbf2d6204c40c0ad3ea7a6f
Reviewed-on: https://code.wireshark.org/review/1242
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-04-21 17:50:42 +00:00