Skip to content

Impossible to parse a header with padding #20

@maxhawkins

Description

@maxhawkins

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions