aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2018-05-07 22:05:56 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2018-05-08 13:29:40 +0000
commitc2eb71c25c726213f8dbc03b8c34b84ffaa560d7 (patch)
treef46ad9efb8d550915296ba85b44ce7faa94add19
parent7782cb86886e5502f6d2b322d2e966079b8ff3b9 (diff)
Qt: fix IPv4 GeoIP lookup in endpoints dialog
maxmind_db_lookup_ipv4() expects an address in network byte order Bug: 14656 Change-Id: Ie47e3ae44d305d040e409d42f4398f55ae8c2395 Reviewed-on: https://code.wireshark.org/review/27391 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Christopher Maynard Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
-rw-r--r--ui/qt/endpoint_dialog.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/qt/endpoint_dialog.cpp b/ui/qt/endpoint_dialog.cpp
index ccd1cd3657..6cdf02ca1a 100644
--- a/ui/qt/endpoint_dialog.cpp
+++ b/ui/qt/endpoint_dialog.cpp
@@ -210,7 +210,9 @@ public:
const mmdb_lookup_t *mmdb_lookup = NULL;
if (endp_item->myaddress.type == AT_IPv4) {
- mmdb_lookup = maxmind_db_lookup_ipv4(pntoh32(endp_item->myaddress.data));
+ guint32 ip;
+ memcpy(&ip, endp_item->myaddress.data, 4);
+ mmdb_lookup = maxmind_db_lookup_ipv4(ip);
} else if (endp_item->myaddress.type == AT_IPv6) {
mmdb_lookup = maxmind_db_lookup_ipv6((ws_in6_addr *) endp_item->myaddress.data);
}