aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bt-dht.c
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2013-04-15 08:42:12 +0000
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2013-04-15 08:42:12 +0000
commit05e954f48ccc7b7bf808fda62b00f16d06319ea9 (patch)
tree125b77f1c9fb89fca758a3e7e7db369ef7ca0a80 /epan/dissectors/packet-bt-dht.c
parentddb1685c937a4dc42ab201b7ef0e8997c2de3147 (diff)
From report of chen li via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8572 Endian error and IP:Port error when decoding BT-DHT response message
When the remote client sended a node set, it contains nodes info The node info it shows like (1 3cad1f360cc51870d3e68d61ed604078bc608ee2 60.173.31.54:43365), but this node's true ip and port is 99.192.73.131:26025. When we expand these items, the ips and ports in detailed information are right. From me : It is a problem of encoding (LITTLE ENDIAN => BIG ENDIAN) and wrong offset Some issue with Peers info svn path=/trunk/; revision=48850
Diffstat (limited to 'epan/dissectors/packet-bt-dht.c')
-rw-r--r--epan/dissectors/packet-bt-dht.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-bt-dht.c b/epan/dissectors/packet-bt-dht.c
index b129fcc3a6..80dff9d8c6 100644
--- a/epan/dissectors/packet-bt-dht.c
+++ b/epan/dissectors/packet-bt-dht.c
@@ -261,7 +261,7 @@ dissect_bt_dht_values(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint
{
peer_index += 1;
TVB_SET_ADDRESS( &addr, AT_IPv4, tvb, offset, 4);
- port = tvb_get_letohl( tvb, offset+4 );
+ port = tvb_get_ntohs( tvb, offset+4 );
value_ti = proto_tree_add_none_format( sub_tree, hf_bt_dht_peer, tvb, offset, 6,
"%d\t%s:%u", peer_index, ep_address_to_str( &addr ), port );
@@ -310,8 +310,8 @@ dissect_bt_dht_nodes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint
node_index += 1;
id = tvb_bytes_to_str(tvb, offset, 20 );
- TVB_SET_ADDRESS( &addr, AT_IPv4, tvb, offset, 4);
- port = tvb_get_letohl( tvb, offset+24 );
+ TVB_SET_ADDRESS( &addr, AT_IPv4, tvb, offset+20, 4);
+ port = tvb_get_ntohs( tvb, offset+24 );
node_ti = proto_tree_add_none_format( sub_tree, hf_bt_dht_node, tvb, offset, 26,
"%d\t%s %s:%u", node_index, id, ep_address_to_str( &addr ), port );