aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-lwm.c
diff options
context:
space:
mode:
authorOwen Kirby <osk@exegin.com>2017-06-23 15:15:46 -0700
committerAnders Broman <a.broman58@gmail.com>2017-07-20 07:32:36 +0000
commit79e801806aedbbb74f642fafd9f54c02e60677f5 (patch)
treefe4f3c03368560588fa0b4693154eed6b15869af /epan/dissectors/packet-lwm.c
parent07f27d8238021b6e485699369383a58f95984a4e (diff)
ZigBee: Add touchlink commissioning dissectors.
Change-Id: I745fa77626dd242d9a6f1bd79c6ae52d507f844a Reviewed-on: https://code.wireshark.org/review/22380 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-lwm.c')
-rw-r--r--epan/dissectors/packet-lwm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/epan/dissectors/packet-lwm.c b/epan/dissectors/packet-lwm.c
index 7bbcce0d12..644729b124 100644
--- a/epan/dissectors/packet-lwm.c
+++ b/epan/dissectors/packet-lwm.c
@@ -181,6 +181,8 @@ static const value_string lwm_cmd_multi_names[] = {
static gboolean
dissect_lwm_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
+ guint8 endpt, srcep, dstep;
+
/* 1) first byte must have bits 0000xxxx */
if(tvb_get_guint8(tvb, 0) & LWM_FCF_RESERVED)
return (FALSE);
@@ -189,6 +191,15 @@ dissect_lwm_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
if (tvb_reported_length(tvb) < LWM_HEADER_BASE_LEN)
return (FALSE);
+ /* The endpoints should either both be zero, or both non-zero. */
+ endpt = tvb_get_guint8(tvb, 6);
+ srcep = (endpt & LWM_SRC_ENDP_MASK) >> LWM_SRC_ENDP_OFFSET;
+ dstep = (endpt & LWM_DST_ENDP_MASK) >> LWM_DST_ENDP_OFFSET;
+ if ((srcep == 0) && (dstep != 0))
+ return (FALSE);
+ if ((srcep != 0) && (dstep == 0))
+ return (FALSE);
+
dissect_lwm(tvb, pinfo, tree, data);
return (TRUE);
} /* dissect_lwm_heur */