diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/wimax/msg_ulmap.c | 4 | ||||
-rw-r--r-- | plugins/wimax/wimax_bits.h | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/plugins/wimax/msg_ulmap.c b/plugins/wimax/msg_ulmap.c index 9bf0d9977c..7c4689103f 100644 --- a/plugins/wimax/msg_ulmap.c +++ b/plugins/wimax/msg_ulmap.c @@ -1595,8 +1595,8 @@ gint dissect_ulmap_ie( proto_tree *ie_tree, const guint8 *bufptr, gint offset, g nibble = offset; /* 8.4.5.4 UL-MAP IE format - table 287 */ - cid = NIB_WORD(nibble, bufptr); - uiuc = NIB_NIBBLE(nibble + 4, bufptr); + cid = TVB_NIB_WORD(nibble, tvb); + uiuc = TVB_NIB_NIBBLE(nibble + 4, tvb); if (uiuc == 0) { diff --git a/plugins/wimax/wimax_bits.h b/plugins/wimax/wimax_bits.h index 53b05b7e0c..7eca8f5fb2 100644 --- a/plugins/wimax/wimax_bits.h +++ b/plugins/wimax/wimax_bits.h @@ -55,6 +55,10 @@ (((n) & 1) \ ? (b)[(n)/2] & NIBBLE_MASK \ : ((b)[(n)/2] >> 4) & NIBBLE_MASK) +#define TVB_NIB_NIBBLE(n,t) \ + (((n) & 1) \ + ? tvb_get_guint8((t), (n)/2) & NIBBLE_MASK \ + : (tvb_get_guint8((t), (n)/2) >> 4) & NIBBLE_MASK) /* extract the byte at the given nibble address 'n' of buffer 'b' */ #define NIB_BYTE(n,b) \ @@ -78,6 +82,10 @@ : pletoh16((b) + (n)/2) ? (pletoh32((b)+(n)/2) >> 12) & 0x0000FFFF \ */ +#define TVB_NIB_WORD(n,t) \ + (n) & 1 \ + ? (gint)((tvb_get_ntohl((t), (n)/2) >> 12) & 0x0000FFFF) \ + : tvb_get_ntohs((t), (n)/2) /* extract the word at the given nibble address 'n' of buffer 'b' */ #define NIB_LONG(n,b) \ |