diff options
author | Dario Lombardo <lomato@gmail.com> | 2016-08-09 17:16:48 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-08-09 21:39:08 +0000 |
commit | 3b557f6825cd6df329a69591fbb123fc5b37d91f (patch) | |
tree | ca9c3795b639688ee12c3f36c47afb39b0ea6412 | |
parent | 9ac3aada49ea489bbb8de99bcfd3768be2c62025 (diff) | |
download | wireshark-3b557f6825cd6df329a69591fbb123fc5b37d91f.tar.gz |
wccp: fix bitwise operations (CID 1312144 & 1312145).
Change-Id: I62cdb1eb7c62ab09bd43d0e0760bdedb4b1725c8
Reviewed-on: https://code.wireshark.org/review/16976
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/dissectors/packet-wccp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-wccp.c b/epan/dissectors/packet-wccp.c index 81a1eea8d1..88aa7f638f 100644 --- a/epan/dissectors/packet-wccp.c +++ b/epan/dissectors/packet-wccp.c @@ -564,8 +564,8 @@ static void wccp_fmt_ipaddress(gchar *buffer, guint32 host_addr, wccp_address_ta else { /* we need to decode the encoded address: */ - guint16 reserv = (host_addr & 0xFF00) >> 16; - guint16 addr_index = (host_addr & 0x00FF); + guint16 reserv = (host_addr & 0xFFFF0000) >> 16; + guint16 addr_index = (host_addr & 0x0000FFFF); if (reserv != 0) { g_snprintf(buffer, ITEM_LABEL_LENGTH, "INVALID: reserved part non zero"); @@ -645,8 +645,8 @@ static proto_item* wccp_add_ipaddress_item(proto_tree* tree, int hf_index, int h host_addr = tvb_get_ntohl(tvb, offset); /* we need to decode the encoded address: */ - reserv = (host_addr & 0xFF00) >> 16; - addr_index = (host_addr & 0x00FF); + reserv = (host_addr & 0xFFFF0000) >> 16; + addr_index = (host_addr & 0x0000FFFF); memset(&ipv6_zero, 0, sizeof(ipv6_zero)); |