dotpcap / packetnet

Official repository - High performance .Net assembly for dissecting and constructing network packets such as ethernet, ip, tcp, udp etc.
Mozilla Public License 2.0
476 stars 105 forks source link

fix RtpPacket and RtcpPacket bitmask setter logic #209

Closed SteveAyre closed 3 months ago

SteveAyre commented 4 months ago

The PayloadType setter uses header[offset] |= value & bitmask to set the value.

However this only sets the bits in the new value, it does not unset existing bits not in the value. While the setter works when the current header byte is zero, it fails if the RTP header already has a payload type value to be changed.

The same bug also appears to affect ReceptionReportCount and CsrcCount.