Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to parse a header with padding #20

Open
maxhawkins opened this issue Apr 4, 2019 · 1 comment
Open

Impossible to parse a header with padding #20

maxhawkins opened this issue Apr 4, 2019 · 1 comment

Comments

@maxhawkins
Copy link
Contributor

Your environment.

What did you do?

rrWithPadding := []byte{
	// v=2, p=1, count=1, RR, len=7
	0xa1, 0xc9, 0x0, 0x7,
	// ssrc=0x902f9e2e
	0x90, 0x2f, 0x9e, 0x2e,
	// ssrc=0xbc5e9a40
	0xbc, 0x5e, 0x9a, 0x40,
	// fracLost=0, totalLost=0
	0x0, 0x0, 0x0, 0x0,
	// lastSeq=0x46e1
	0x0, 0x0, 0x46, 0xe1,
	// jitter=273
	0x0, 0x0, 0x1, 0x11,
	// lsr=0x9f36432
	0x9, 0xf3, 0x64, 0x32,
	// delay=150137
	0x0, 0x2, 0x4a, 0x79,
}
pkts, _ := Unmarshal(rrWithPadding)
fmt.Println(pkts[0].Header().Padding)

What did you expect?

For it to return true, since the padding flag is set.

What happened?

It returns false, because we use a synthetic header after parsing, and this header always has the padding bit set to false.

This is fine for most cases, but it means that we can't implement the validity check that requires the first packet in a compound doesn't have padding.

maxhawkins added a commit that referenced this issue Apr 7, 2019
Due to #20 this check is a no-op. Removing it here so no one is
misled into thinking that we implement this feature.

Relates to #25
maxhawkins added a commit that referenced this issue Apr 7, 2019
Due to #20 this check is a no-op. Removing it here so no one is
misled into thinking that we implement this feature.

Relates to #25
@aler9
Copy link
Member

aler9 commented Aug 13, 2022

This can be solved by adding a PaddingSize field to every rtcp.Packet, like rtp.Packet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants