aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gtpv2.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2016-07-29 21:05:25 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2016-07-29 19:08:13 +0000
commit65b9d561cd69839f741e8137934b8a8f5a28f6b5 (patch)
tree1a86879cce20c03453d14c088cbe05e12f33509e /epan/dissectors/packet-gtpv2.c
parentfe7dd4e76eb9384333fdffc6cb49b631e58483c9 (diff)
GTPv2: fix test for flags in TWAN Identifier IE (CID 1364616)
Change-Id: I7b87624bd60f514f2f5e9aafe19bcebf7799bcd1 Reviewed-on: https://code.wireshark.org/review/16772 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-gtpv2.c')
-rw-r--r--epan/dissectors/packet-gtpv2.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c
index f8758efe8d..9bd9687249 100644
--- a/epan/dissectors/packet-gtpv2.c
+++ b/epan/dissectors/packet-gtpv2.c
@@ -5729,14 +5729,14 @@ dissect_gtpv2_twan_identifier(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
proto_tree_add_item(tree, hf_gtpv2_twan_ssid, tvb, offset, ssid_len, ENC_NA);
offset += ssid_len;
/* (k+1) to (k+6) BSSID The BSSIDI flag in octet 5 indicates whether the BSSID in octets 'k+1' to 'k+6' shall be present.*/
- if ((flags & 1) == 1) {
+ if (flags & 0x01) {
proto_tree_add_item(tree, hf_gtpv2_twan_bssid, tvb, offset, 6, ENC_NA);
offset += 6;
}
/* q Civic Address Length The CIVAI flag in octet 5 indicates whether the Civic Address Length
* and Civic Address Information in octets 'q' and 'q+1' to 'q+r' shall be present.
*/
- if ((flags & 2) == 1) {
+ if (flags & 0x02) {
proto_tree_add_item_ret_uint(tree, hf_gtpv2_twan_civa_len, tvb, offset, 1, ENC_BIG_ENDIAN, &civa_len);
offset += 1;
/* (q+1) to (q+r) Civic Address Information
@@ -5758,7 +5758,7 @@ dissect_gtpv2_twan_identifier(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
/* s to (s+3) TWAN PLMN-ID The PLMNI flag in octet 5 indicates whether the TWAN PLMN-ID
* in octets 's' to 's+3' shall be present
*/
- if ((flags & 4) == 1) {
+ if (flags & 0x04) {
proto_tree_add_item_ret_uint(tree, hf_gtpv2_twan_plmnid, tvb, offset, 3, ENC_BIG_ENDIAN, &civa_len);
offset += 3;
/* (q+1) to (q+r) Civic Address Information
@@ -5768,7 +5768,7 @@ dissect_gtpv2_twan_identifier(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
/* t TWAN Operator Name Length, The OPNAI flag in octet 5 indicates whether the TWAN Operator Name Length and
* TWAN Operator Name in octets 't' and 't+1' to 't+u' shall be present.
*/
- if ((flags & 8) == 1) {
+ if (flags & 0x08) {
proto_tree_add_item_ret_uint(tree, hf_gtpv2_twan_op_name_len, tvb, offset, 1, ENC_BIG_ENDIAN, &op_name_len);
offset += 1;
/* (t+1) to (t+u) TWAN Operator Name. The TWAN Operator Name shall be encoded as specified in subclause 19. 8 of 3GPP TS 23.003 */
@@ -5776,7 +5776,7 @@ dissect_gtpv2_twan_identifier(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
offset += op_name_len;
}
/* The LAII flag in octet 5 indicates whether the Logical Access ID information is present in the TWAN Identifier */
- if ((flags & 8) == 1) {
+ if (flags & 0x10) {
/* v Relay Identity Type */
proto_tree_add_item_ret_uint(tree, hf_gtpv2_twan_relay_id_type, tvb, offset, 1, ENC_BIG_ENDIAN, &relay_id_type);
offset += 1;