diff options
author | Diederik de Groot <ddegroot@talon.nl> | 2015-09-13 12:26:23 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2015-09-13 19:24:00 +0000 |
commit | cf49f71c59b4b418ae04e4b70cac63f7f0b902ed (patch) | |
tree | 9a40a6037876c97a90b10b09d089d868b07b0e42 /epan/dissectors/packet-skinny.c | |
parent | f2c5dee77c877e854460788c9f29342d4adb5499 (diff) |
dissector-skinny: Update skinny dissector to fix ServerRes Message
ServerRes message does not follow other message when it comes to
provinding the list of ip-addresses. The type of ip-address (IPv4
or IPv6 does not depend on the protocol version but the length of
the message.
Fix: ipv4 address displayed as ip-address
Change-Id: Ie16f81c9482b30a80da37b9327b09e933d7808f8
Reviewed-on: https://code.wireshark.org/review/10513
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-skinny.c')
-rw-r--r-- | epan/dissectors/packet-skinny.c | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/epan/dissectors/packet-skinny.c b/epan/dissectors/packet-skinny.c index 176e175676..2edae7b931 100644 --- a/epan/dissectors/packet-skinny.c +++ b/epan/dissectors/packet-skinny.c @@ -4880,6 +4880,8 @@ handle_RegisterRejectMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) static void handle_ServerResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) { + guint32 hdr_data_length = tvb_get_letohl(ptvcursor_tvbuff(cursor), 0); + { /* start struct : server / size: 48 */ guint32 counter_1 = 0; @@ -4901,18 +4903,35 @@ handle_ServerResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_) } ptvcursor_pop_subtree(cursor); /* end for loop tree: serverTcpListenPort */ } - { - /* start struct : serverIpAddr / size: 20 */ - guint32 counter_1 = 0; - ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH, ett_skinny_tree, "serverIpAddr [max:5]"); - for (counter_1 = 0; counter_1 < 5; counter_1++) { - ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH, ett_skinny_tree, "serverIpAddr [%d / %d]", counter_1 + 1, 5); - dissect_skinny_ipv4or6(cursor, hf_skinny_stationIpAddr_ipv4, hf_skinny_stationIpAddr_ipv6, pinfo); + if (hdr_data_length < 293) { + { + /* start struct : serverIpAddr / size: 4 */ + guint32 counter_2 = 0; + ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH, ett_skinny_tree, "serverIpAddr [max:5]"); + for (counter_2 = 0; counter_2 < 5; counter_2++) { + ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH, ett_skinny_tree, "serverIpAddr [%d / %d]", counter_2 + 1, 5); + ptvcursor_add(cursor, hf_skinny_stationIpAddr, 4, ENC_BIG_ENDIAN); + ptvcursor_pop_subtree(cursor); + /* end for loop tree: serverIpAddr */ + } ptvcursor_pop_subtree(cursor); - /* end for loop tree: serverIpAddr */ + /* end struct: serverIpAddr */ + } + } + if (hdr_data_length > 292) { + { + /* start struct : serverIpAddr / size: 20 */ + guint32 counter_2 = 0; + ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH, ett_skinny_tree, "serverIpAddr [max:5]"); + for (counter_2 = 0; counter_2 < 5; counter_2++) { + ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH, ett_skinny_tree, "serverIpAddr [%d / %d]", counter_2 + 1, 5); + dissect_skinny_ipv4or6(cursor, hf_skinny_stationIpAddr_ipv4, hf_skinny_stationIpAddr_ipv6, pinfo); + ptvcursor_pop_subtree(cursor); + /* end for loop tree: serverIpAddr */ + } + ptvcursor_pop_subtree(cursor); + /* end struct: serverIpAddr */ } - ptvcursor_pop_subtree(cursor); - /* end struct: serverIpAddr */ } } |