mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
module-rtp: fix SAP header parsing for IPv6
If the originating source is IPv6, the A bit is set and the source is 16 bytes compared to 4 bytes for IPv4. Fixes #3851
This commit is contained in:
parent
de617697be
commit
791455c83f
1 changed files with 4 additions and 2 deletions
|
|
@ -1174,7 +1174,7 @@ static int parse_sap(struct impl *impl, void *data, size_t len)
|
||||||
if (header->c)
|
if (header->c)
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
|
|
||||||
offs = header->a ? 12 : 8;
|
offs = header->a ? 20 : 8;
|
||||||
offs += header->auth_len * 4;
|
offs += header->auth_len * 4;
|
||||||
if (len <= offs)
|
if (len <= offs)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
@ -1214,6 +1214,7 @@ static void
|
||||||
on_sap_io(void *data, int fd, uint32_t mask)
|
on_sap_io(void *data, int fd, uint32_t mask)
|
||||||
{
|
{
|
||||||
struct impl *impl = data;
|
struct impl *impl = data;
|
||||||
|
int res;
|
||||||
|
|
||||||
if (mask & SPA_IO_IN) {
|
if (mask & SPA_IO_IN) {
|
||||||
uint8_t buffer[2048];
|
uint8_t buffer[2048];
|
||||||
|
|
@ -1227,7 +1228,8 @@ on_sap_io(void *data, int fd, uint32_t mask)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
buffer[len] = 0;
|
buffer[len] = 0;
|
||||||
parse_sap(impl, buffer, len);
|
if ((res = parse_sap(impl, buffer, len)) < 0)
|
||||||
|
pw_log_warn("error parsing SAP: %s", spa_strerror(res));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue