diff options
-rw-r--r-- | epan/dissectors/packet-batadv.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/epan/dissectors/packet-batadv.c b/epan/dissectors/packet-batadv.c index 56f365d4b8..d626c40a88 100644 --- a/epan/dissectors/packet-batadv.c +++ b/epan/dissectors/packet-batadv.c @@ -461,6 +461,9 @@ static void dissect_batadv_batman_v5(tvbuff_t *tvb, packet_info *pinfo, proto_tr } } + /* Calculate offset even when we got no tree */ + offset = BATMAN_PACKET_V5_SIZE + batman_packeth->num_hna * 6; + length_remaining = tvb_length_remaining(tvb, offset); if (length_remaining >= BATMAN_PACKET_V5_SIZE) { next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1); @@ -572,6 +575,9 @@ static void dissect_batadv_batman_v7(tvbuff_t *tvb, packet_info *pinfo, proto_tr } } + /* Calculate offset even when we got no tree */ + offset = BATMAN_PACKET_V7_SIZE + batman_packeth->num_hna * 6; + length_remaining = tvb_length_remaining(tvb, offset); if (length_remaining >= BATMAN_PACKET_V7_SIZE) { next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1); @@ -692,6 +698,9 @@ static void dissect_batadv_batman_v9(tvbuff_t *tvb, packet_info *pinfo, proto_tr } } + /* Calculate offset even when we got no tree */ + offset = BATMAN_PACKET_V9_SIZE + batman_packeth->num_hna * 6; + length_remaining = tvb_length_remaining(tvb, offset); if (length_remaining >= BATMAN_PACKET_V9_SIZE) { next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1); @@ -798,6 +807,9 @@ static void dissect_batadv_bcast_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tre offset += 2; } + /* Calculate offset even when we got no tree */ + offset = BCAST_PACKET_V6_SIZE; + SET_ADDRESS(&pinfo->dl_src, AT_ETHER, 6, orig_addr); SET_ADDRESS(&pinfo->src, AT_ETHER, 6, orig_addr); @@ -907,6 +919,9 @@ static void dissect_batadv_icmp_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tree offset += 1; } + /* Calculate offset even when we got no tree */ + offset = ICMP_PACKET_V6_SIZE; + SET_ADDRESS(&pinfo->dl_src, AT_ETHER, 6, orig_addr); SET_ADDRESS(&pinfo->src, AT_ETHER, 6, orig_addr); @@ -991,6 +1006,9 @@ static void dissect_batadv_icmp_v7(tvbuff_t *tvb, packet_info *pinfo, proto_tree offset += 1; } + /* Calculate offset even when we got no tree */ + offset = ICMP_PACKET_V7_SIZE; + SET_ADDRESS(&pinfo->dl_src, AT_ETHER, 6, orig_addr); SET_ADDRESS(&pinfo->src, AT_ETHER, 6, orig_addr); @@ -1078,6 +1096,9 @@ static void dissect_batadv_unicast_v6(tvbuff_t *tvb, packet_info *pinfo, proto_t offset += 1; } + /* Calculate offset even when we got no tree */ + offset = UNICAST_PACKET_V6_SIZE; + SET_ADDRESS(&pinfo->dl_dst, AT_ETHER, 6, dest_addr); SET_ADDRESS(&pinfo->dst, AT_ETHER, 6, dest_addr); @@ -1191,6 +1212,9 @@ static void dissect_batadv_vis_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tree offset += 6; } + /* Calculate offset even when we got no tree */ + offset = VIS_PACKET_V6_SIZE; + SET_ADDRESS(&pinfo->dl_src, AT_ETHER, 6, sender_orig_addr); SET_ADDRESS(&pinfo->src, AT_ETHER, 6, vis_orig_addr); |