forked from osmocom/wireshark
RTCP: Extended Reports: check for padding
Check if padding flag is set and alter length accordingly.
Display rtcp.xr.bl the same way as rtcp.length.
Fixes: wireshark/wireshark#16933
(cherry picked from commit e07bb433b2
)
This commit is contained in:
parent
746cf80cce
commit
15f52841ca
|
@ -3161,6 +3161,7 @@ static gboolean validate_xr_block_length(tvbuff_t *tvb, packet_info *pinfo, int
|
||||||
proto_item *ti;
|
proto_item *ti;
|
||||||
|
|
||||||
ti = proto_tree_add_uint(tree, hf_rtcp_xr_block_length, tvb, offset, 2, block_len);
|
ti = proto_tree_add_uint(tree, hf_rtcp_xr_block_length, tvb, offset, 2, block_len);
|
||||||
|
proto_item_append_text(ti, " (%u bytes)", (block_len)*4);
|
||||||
switch (block_type) {
|
switch (block_type) {
|
||||||
case RTCP_XR_REF_TIME:
|
case RTCP_XR_REF_TIME:
|
||||||
if (block_len != 2)
|
if (block_len != 2)
|
||||||
|
@ -3190,7 +3191,7 @@ static gboolean validate_xr_block_length(tvbuff_t *tvb, packet_info *pinfo, int
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
dissect_rtcp_xr(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree, gint packet_len)
|
dissect_rtcp_xr(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree, unsigned int padding, gint packet_len)
|
||||||
{
|
{
|
||||||
guint block_num;
|
guint block_num;
|
||||||
|
|
||||||
|
@ -3200,6 +3201,13 @@ dissect_rtcp_xr(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree,
|
||||||
return offset + packet_len;
|
return offset + packet_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (padding) {
|
||||||
|
/* If there's padding present, we have to remove that from the data part
|
||||||
|
* The last octet of the packet contains the length of the padding
|
||||||
|
*/
|
||||||
|
packet_len -= tvb_get_guint8(tvb, offset + packet_len - 1);
|
||||||
|
}
|
||||||
|
|
||||||
/* SSRC */
|
/* SSRC */
|
||||||
proto_tree_add_item( tree, hf_rtcp_ssrc_sender, tvb, offset, 4, ENC_BIG_ENDIAN );
|
proto_tree_add_item( tree, hf_rtcp_ssrc_sender, tvb, offset, 4, ENC_BIG_ENDIAN );
|
||||||
offset += 4;
|
offset += 4;
|
||||||
|
@ -4456,7 +4464,7 @@ dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U
|
||||||
offset++;
|
offset++;
|
||||||
/* Packet length in 32 bit words MINUS one, 16 bits */
|
/* Packet length in 32 bit words MINUS one, 16 bits */
|
||||||
offset = dissect_rtcp_length_field(rtcp_tree, tvb, offset);
|
offset = dissect_rtcp_length_field(rtcp_tree, tvb, offset);
|
||||||
offset = dissect_rtcp_xr( tvb, pinfo, offset, rtcp_tree, packet_length - 4 );
|
offset = dissect_rtcp_xr( tvb, pinfo, offset, rtcp_tree, padding_set, packet_length - 4 );
|
||||||
break;
|
break;
|
||||||
case RTCP_AVB:
|
case RTCP_AVB:
|
||||||
/* Subtype, 5 bits */
|
/* Subtype, 5 bits */
|
||||||
|
|
Loading…
Reference in New Issue