diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-02-22 12:21:47 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-02-22 20:22:07 +0000 |
commit | b9296b721f2e819f4243f100e102489c7ac4d718 (patch) | |
tree | 786eee9d21cd73c14597bb80b34390de6712e286 | |
parent | 08bee7d71b6a3cba733b65842e0a68a6ebc3973a (diff) |
Fix handling of longitude and latitude values.
The formatting routine is getting passed the 5-byte value, not some
8-byte value that includes the 3 bytes after it, so shifting it produces
the wrong value.
Make the longitude and latitude FT_UINT40, as they're only 5 bytes long.
Change-Id: I35aa05887bcfdfc1107fef2ac5069f1fe96fda3a
Reviewed-on: https://code.wireshark.org/review/7321
Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r-- | epan/dissectors/packet-lldp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-lldp.c b/epan/dissectors/packet-lldp.c index 86765c4a83..ed9e5edc8b 100644 --- a/epan/dissectors/packet-lldp.c +++ b/epan/dissectors/packet-lldp.c @@ -1036,7 +1036,7 @@ media_power_base(gchar *buf, guint32 value) { static void get_latitude_or_longitude(gchar *buf, int option, guint64 unmasked_value) { - guint64 value = (unmasked_value & G_GINT64_CONSTANT(0x03FFFFFFFF000000)) >> 24; + guint64 value = unmasked_value & G_GINT64_CONSTANT(0x03FFFFFFFF); guint64 tempValue = value; gboolean negativeNum = FALSE; guint32 integerPortion = 0; @@ -4595,7 +4595,7 @@ proto_register_lldp(void) NULL, 0xFC, NULL, HFILL } }, { &hf_media_loc_lat, - { "Latitude", "lldp.media.loc.latitude", FT_UINT64, BASE_CUSTOM, + { "Latitude", "lldp.media.loc.latitude", FT_UINT40, BASE_CUSTOM, CF_FUNC(latitude_base), 0x0, NULL, HFILL } }, { &hf_media_loc_long_resolution, @@ -4603,7 +4603,7 @@ proto_register_lldp(void) NULL, 0xFC, NULL, HFILL } }, { &hf_media_loc_long, - { "Longitude", "lldp.media.loc.longitude", FT_UINT64, BASE_CUSTOM, + { "Longitude", "lldp.media.loc.longitude", FT_UINT40, BASE_CUSTOM, CF_FUNC(longitude_base), 0x0, NULL, HFILL } }, { &hf_media_loc_alt_type, |