Commit Graph

20815 Commits

Author SHA1 Message Date
Evan Huus be4d42c6ab Widen openflow variables and check for underflows
As suggested by Alexis reviewing change Ie76c5a810af927b, this issue was
scattered throughout the v4/v5 openflow dissectors. Hopefully I got all of them.
Original issue found in bug 10259.

Change-Id: Idf87deea34132aec5cd4e8f83264906a29b15568
Reviewed-on: https://code.wireshark.org/review/2878
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-07-06 16:53:39 +00:00
Peter Wu 5886e45179 iscsi: minor retval fix
The return value of new dissectors is the number of bytes that were
successfully dissected, not a boolean. Fix that and get rid of an
unnecessary iSCSIPdusDissected variable.

Change-Id: Ie31df393a1eb44f185d320a4c2d35f5e8b7d7bd9
Reviewed-on: https://code.wireshark.org/review/2889
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-06 15:51:45 +00:00
Peter Wu d828b15a82 kismet: fix retval, add modelines
new dissectors return an int, not a boolean...

Change-Id: I88e19f7c0dc14da3649d1522ffe936538a867753
Reviewed-on: https://code.wireshark.org/review/2888
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-06 15:47:51 +00:00
Peter Wu 2eae8bb0c3 mikey: do not request more data on proto violation
Return value "-1" means that more data is requested. The dissector
actually doesn't have any idea what to do with the data, so just return
the data dissected so far.

tcp stream 3182 from c05-http-reply-r1.pcap (SampleCaptures) was
incorrectly detected as MIKEY, it was actually HTTP...

Change-Id: Idca3d3e2f85e821df70436a675699b5834236f89
Reviewed-on: https://code.wireshark.org/review/2887
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-06 15:45:33 +00:00
Peter Wu b54731dc7d ms-mms: fix retval for short pkts, fix reading flags
uint16 & 0xFF00 will always equal 0. Use tvb_get_guint8 instead. Convert
from tvb_length to tvb_captured_length.

Fix the return value of dissectors, 0 means reject but that cannot be
combined with reassembly requests.

Change-Id: I5fca66e2e809699392237aff5813eecdfb15857f
Reviewed-on: https://code.wireshark.org/review/2885
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-06 15:42:58 +00:00
Evan Huus 4afd70d4e4 Use g_hash_table_new_full to free some values
Fixes a good 80-90KB of leaks in certain cases.

Bug: 10261
Change-Id: I81d57ac67219e730b03649b9fdfc2306807bdb97
Reviewed-on: https://code.wireshark.org/review/2879
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-06 14:27:27 +00:00
Michael Mann 6318a29fa3 convert to proto_tree_add_subtree[_format]
Change-Id: Ia2567695ffed30c990eda3740b08bfab101cea96
Reviewed-on: https://code.wireshark.org/review/2883
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-06 14:21:15 +00:00
Guy Harris db530d886d Squelch casting-away-constness warnings.
The pStr argument to dissect_mq_charv() isn't modified (and always
points to a character string), so make it a "const char *", and
eliminate the casts to "guint8 *" in calls to it.

Change-Id: I21dad38c41324528be297a8ddc1854beff2276db
Reviewed-on: https://code.wireshark.org/review/2877
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 11:25:41 +00:00
Роман Донченко afa8f21f56 make-dissectors-reg: optimize by factoring out the loops
Instead of calling the grep/sed pipelines for each file, build the
list of files in the beginning and call each pipeline only once,
passing the list to the first grep.

This results in a massive speedup in Cygwin; in my test, the time
it takes to run make-dissector-reg . dissectors packet-*.c in dissectors/epan
is reduced from ~116 to ~3 seconds. I also tried it on NetBSD, where
the time do to the same goes from ~6 to ~0.5 seconds.

Amend makefile comments to elide mentions of invoking multiple processes
per file.

Change-Id: Iad441e7d2b6cc3669dada57646e2f8f6b987fd34
Reviewed-on: https://code.wireshark.org/review/2826
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-06 08:08:20 +00:00
Michael Mann 3490bc6eb9 Change display filters to prefix with ipmi.trace
Change-Id: I7b4476cb0a06362941ef81707a9686f5546a4a54
Reviewed-on: https://code.wireshark.org/review/2868
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-06 08:03:29 +00:00
Michael Mann 0335ae339d convert to proto_tree_add_subtree[_format]
Change-Id: I66f0bffb987568c3d4c14a06bdc90465c877b27f
Reviewed-on: https://code.wireshark.org/review/2867
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-05 23:08:19 +00:00
Peter Wu 286c191846 9p: fix version detection, fix dissect_9P retval
Fix version detection (detect against full string instead of prefix),
properly dissect Tcreate extension field (9p2000.u only), dissect
Tunlinkat flags (9p2000.L).

Refactor pattern to dissect string[s] types for DRY.

Convert to use tcp_dissect_pdus. I have not seen a fragmented case, but
maybe that may happen in the future.

The main motivation for touching 9p was that it returns bogus values
for some types. This has been fixed by properly increasing offset, and
always return the captured length.

Change-Id: If2184204ae9c853b94aca8ade3763d7fe523fa86
Reviewed-on: https://code.wireshark.org/review/2836
Reviewed-by: Christopher Maynard <Christopher.Maynard@gtech.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-05 22:04:54 +00:00
Michael Mann fc63343a4e convert to proto_tree_add_subtree[_format]
Change-Id: I8df48b25de784a48a25f0e48aac1e1545ed92c35
Reviewed-on: https://code.wireshark.org/review/2865
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-05 20:36:36 +00:00
Evan Huus c92bf7e44b Expand a variable from 16 to 32 bits (and make it signed).
Fixes an overflow leading to infinite loop.

Bug: 10259
Change-Id: Ie76c5a810af927ba092f4067268bd789b3a7d7bf
Reviewed-on: https://code.wireshark.org/review/2856
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-04 21:53:08 +00:00
Pascal Quantin e398c8ed6b ETSI CAT: upgrade dissector to Release 12
Change-Id: Id1988551ca94a862195eb1de1de399e428132b21
Reviewed-on: https://code.wireshark.org/review/2855
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-07-04 19:38:41 +00:00
Michael Mann c7a6e6fa13 convert to proto_tree_add_subtree[_format]
Change-Id: I621f2e2cad9403449cb78f45302388f0c874d3bc
Reviewed-on: https://code.wireshark.org/review/2852
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-04 16:59:14 +00:00
Michael Mann 93517043e9 convert to proto_tree_add_subtree[_format]
Change-Id: Idd1b20ab32c0960ea52c6f3bc5346462c37c5684
Reviewed-on: https://code.wireshark.org/review/2853
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-04 16:46:14 +00:00
AndersBroman dd424c6225 Handle the case where the previous PDU has left an extra CRLF in the stream.RFC 2626 In the interest of robustness, servers SHOULD ignore any empty line(s) received where a Request-Line is expected. In other words, if the server is reading the protocol stream at the beginning of a message and receives a CRLF first, it should ignore the CRLF.
Change-Id: I97ba94f451463c8facd2c20bf6b7364f095119e7
Reviewed-on: https://code.wireshark.org/review/2808
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-04 14:00:50 +00:00
Evan Huus 7e970c32f4 wmemify some nfs functions, fixing much leaked memory
Bug: 10257
Change-Id: Ia36c03b2be727a37f91eca38af4faf48d1d65436
Reviewed-on: https://code.wireshark.org/review/2840
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-04 07:59:04 +00:00
Evan Huus 7464415049 Fix infinite loop in RTCP dissector
Bug: 10248
Change-Id: I630bc1ab2520c2861b817ba5813f5f7680e96056
Reviewed-on: https://code.wireshark.org/review/2820
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-04 02:21:48 +00:00
Sean O. Stalley bbb3e2f7af Add Bus ID to USB Address Column
USB Addresses are now in the format of: bus_id.device_address.endpoint
This makes it much easier to read traces that captured traffic on
more than one bus.

Change-Id: I264db2ceea712d94632d5d08d05d3af22a4a03fe
Reviewed-on: https://code.wireshark.org/review/2833
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-04 02:20:38 +00:00
Sean O. Stalley 212df87e7f (trivial) moved 'is request' comment in dissect_usb_common()
Change-Id: I759f64920284a35ea55bc68624570def51dfd72a
Reviewed-on: https://code.wireshark.org/review/2832
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-04 02:18:17 +00:00
Bill Meier 4e74546e76 packet-vnc.c: Fix a bug in displaying a set of FT_BOOLEAN bit fields (found by checkAPIs).
Change-Id: Ie5252d20db5826f3e48aba11da1bf85d00630db2
Reviewed-on: https://code.wireshark.org/review/2838
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-07-03 23:34:06 +00:00
Bill Meier 3e325b1448 packet-vnc.c: Restore tvb_get_string() --> tvb_get_string_enc() changes lost in gdf6bdcc
These changes were originally done in g971ffd6

Change-Id: I9de28ba7089f99e8058207f3b6d34de931decf76
Reviewed-on: https://code.wireshark.org/review/2835
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-07-03 22:26:27 +00:00
Bill Meier df6bdcc07d packet-vnc.c: Improve dissection
- Properly dissect multiple VNC PDUs in one (or more) TCP segment(s).
- Dissect additional message types ('Fence' and 'Enable Continuous Updates').
- Handle "num_rects" field = 0xFFFF (TightVNC).
- Add some more info as to sources of information about the VNC protocol.
- Add an XXX note as to the (incorrect) reassembly method being used.
- Add some notes as to possible ToDo's.

Change-Id: Id4942c50b3d1373bd2e72c0131614835dc39ba90
Reviewed-on: https://code.wireshark.org/review/2834
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-07-03 21:51:17 +00:00
Yan Burman 6ed95406e3 Fix type-o left over from cut-and-paste
Change-Id: I80b24cd8b75999454c1767bd3044ecc569f57d98
Signed-off-by: Yan Burman <yanb@mellanox.com>
Reviewed-on: https://code.wireshark.org/review/2805
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-03 12:22:59 +00:00
AndersBroman f0ed0e69fa Get rid of soft-deprecated API:s
Change-Id: Ieb4a3f07a7831c141ba8ce9c075e72091ef909be
Reviewed-on: https://code.wireshark.org/review/2798
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-03 09:04:33 +00:00
Evan Huus d70e56a733 Revert to 3ms if we don't have the handshake
Change-Id: I96b23677f3050e9c62edd49f26d50d8b4addcf58
Reviewed-on: https://code.wireshark.org/review/2784
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-03 07:32:11 +00:00
Pascal Quantin 2dbab6df18 GTP: add dissection of Extended End User Address
Bug: 10251
Change-Id: I174b5a2b3e2ec8ff2ead9f290b452ee468f6fe66
Reviewed-on: https://code.wireshark.org/review/2783
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-03 07:30:20 +00:00
Michael Mann 980893a15a NDPS dissector is the poster child for proto_tree_add_subtree[_format].
NDPS dissector is also the poster child for not being considered "that naughty" by checkAPIs because most of its proto_tree_add_text calls don't have printf-style arguments (which is what checkAPIs really keys off of)

Fixed both cases and removed about 370 proto_tree_add_text calls from the dissector.

Change-Id: I721678c39d4a0544e5e7212e622c0c2eebfd04f7
Reviewed-on: https://code.wireshark.org/review/2775
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-02 17:35:52 +00:00
Evan Huus a3bac6d0ce kafka: fully dissect offset request/response messages
Change-Id: I641a3dbece6f822144f6740dde6801b1be202db5
Reviewed-on: https://code.wireshark.org/review/2777
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-02 17:29:55 +00:00
Evan Huus 956c440786 RSVP checksum is not required if integrity object is present
Bug: 10219
Change-Id: I2da62ee184327b2bc42a264e1782db927460f5cf
Reviewed-on: https://code.wireshark.org/review/2773
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-02 06:31:58 +00:00
Jakub Zawadzki af7528999f Optimize sip dissector: avoid calling tvb_get_string_enc()
Fetch header value, only when we need to parse it.

Change-Id: I3c170ef8ab03985c8111a1b84ac1afc87bc8b5ca
Reviewed-on: https://code.wireshark.org/review/2767
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-02 06:07:44 +00:00
Malcolm Walters 2a306f4b05 Fix for Bug 10240.
Include padding length in calculation of correct attribute length

Change-Id: I569c6a9e1be39e3bb997e797a094b80cdcba6b07
Reviewed-on: https://code.wireshark.org/review/2747
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-07-01 20:49:30 +00:00
Jakub Zawadzki 852d5dac9c Remove executable bit, from not executable files.
Change-Id: I36b303b9c2bf4d6bb717261cdbf39ea16532fe06
Reviewed-on: https://code.wireshark.org/review/2757
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-07-01 20:37:09 +00:00
Graham Bloice bd79dae438 Remove debugging info from protocol tree for frame
Change-Id: Id7f02087e536964bfa6d01a3646c20035a3ab6cb
Reviewed-on: https://code.wireshark.org/review/2746
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-01 12:44:31 +00:00
Evan Huus a452d16f2c Optimize epan_new/init_dissection
As Anders correctly pointed out in I7d8f84b2e, constantly resetting state will
turn init_dissection into a bit of a hot path. Especially as we will already
bear the overhead of switching files, we don't want to fall any further behind
than we have to.

This change includes three unrelated optimizations that reduce the cost of
init_dissection by about 40% as measured by callgrind:
 - only initialize ares/ADNS if that preference is enabled (this of course only
   applies if you specify -n to tshark or otherwise disable the preference)
 - use memcpy instead of a loop in sigcomp UDVM init
 - use memcpy instead of a loop in bootp dissector

The only remaining obvious hot spot in this path is reassembly_table_init since
it is called by so many dissectors. Suggestions (perhaps to get rid of the
GPtrArray) welcome.

Oh, and one other change to use g_strerror instead of strerror as insisted
upon by the API pre-commit hook.

Change-Id: I18a74f2b64b25498116079bd4e7fc2b335c7703a
Reviewed-on: https://code.wireshark.org/review/2738
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-01 04:21:14 +00:00
Jakub Zawadzki 659d0efc92 sip optimization: avoid calling tvb_get_guint8.
Use tvb_pbrk_guint8, tvb_find_guint8 when possible.

Change-Id: If8090d9b9b92146e9c216f139c056130d6b04e78
Reviewed-on: https://code.wireshark.org/review/2569
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-01 04:15:02 +00:00
Balint Reczey 4e9e043a6a Init session id to avoid warning using GCC 4.9
Change-Id: I2091f7eb86c64fd086f44a7cf15e7c5483f9b44c
Reviewed-on: https://code.wireshark.org/review/2716
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-01 02:05:41 +00:00
Evan Huus f1ff6635a8 Warn about unencrypted HTTP traffic over port 443
At the suggestion of Toralf Förster. This includes an expert info, as well as
making SSL a new-style dissector and rejecting traffic that looks like
unencrypted text.

Change-Id: Ib09ea0d97952330f092590ff3fc6488807cdbb81
Reviewed-on: https://code.wireshark.org/review/2693
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-30 21:10:11 +00:00
AndersBroman 073bf490aa From Johan Whahl:
Added dissection of the SIP Service-Route header.

Change-Id: Ic4523edb374ae03492af5853863dde501a0c30e0
Reviewed-on: https://code.wireshark.org/review/2721
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-30 14:38:46 +00:00
AndersBroman 9387979e91 Fix the display of AVP:s that are not fully dissected
fixes Bug #10237

Change-Id: I3c38bb4af4440f1e5087f21ef022bf2cd3a66002
Reviewed-on: https://code.wireshark.org/review/2720
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-30 14:14:14 +00:00
Michal Labedzki 3b15891115 Bluetooth: Add missing connection_handle
This initialize previously uninitialized variable (and nice fixing everything)

Change-Id: I943102510fc45735f40db7899884d2c0fe6ffb40
Reviewed-on: https://code.wireshark.org/review/2717
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-06-30 13:24:20 +00:00
Michael Mann dd63ae2b8c proto_tree_add_subtree[_format]
Change-Id: Id00f456479415adf0a219af6c9a2108d4b3642d0
Reviewed-on: https://code.wireshark.org/review/2702
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-29 21:18:04 +00:00
Pascal Quantin e39e44df24 GSM MAP: ensure that p2p_dir is always initialized before calling GSM SMS dissector
Bug: 10234
Change-Id: Ie340b849015febe46f91836440d44d4cfde005a4
Reviewed-on: https://code.wireshark.org/review/2695
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-29 17:56:35 +00:00
Gerald Combs f174370ddb [Automatic manuf, services and enterprise-numbers update for 2014-06-29]
Change-Id: Ife61b2e2c53f1faba34940035ac84a2b5ced3b71
Reviewed-on: https://code.wireshark.org/review/2696
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-06-29 15:04:56 +00:00
Michael Mann e8a8d62dc3 proto_tree_add_subtree[_format]
Change-Id: I7e016f10fcfdc0523bf2fe8c11295c0334f7c332
Reviewed-on: https://code.wireshark.org/review/2694
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-29 14:52:33 +00:00
Michael Mann fe4b7ee625 convert to proto_tree_add_subtree[_format]
Change-Id: If110de1e0555637264f86f1508858d569871a9c7
Reviewed-on: https://code.wireshark.org/review/2675
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-29 13:10:02 +00:00
David Ameiss e1a8c9599f Standardize the names of, and document, the taps and heuristic dissector tables made avaialble by these dissectors.
Change-Id: If3a143eb9546c9de63cd32b2347000b09e0e3c93
Reviewed-on: https://code.wireshark.org/review/2688
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-29 00:03:35 +00:00
Graham Bloice 5b9ceae3e5 Remove unused variables post commit 7bf6862ecf
Change-Id: Id583ab1742241deb9325dcb1dbba8a8cb3df3b90
Reviewed-on: https://code.wireshark.org/review/2691
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-06-28 17:41:10 +00:00