Skip to content

Commit 7b6d69d

Browse files
authored
Fix: issue with interpretation of the F bit in the ST40 packet (#1184)
Signed-off-by: Wilczynski, Andrzej <[email protected]>
1 parent 7e92ae1 commit 7b6d69d

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

lib/src/st2110/st_rx_ancillary_session.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,22 +114,20 @@ static int rx_ancillary_session_handle_pkt(struct mtl_main_impl* impl,
114114
}
115115
}
116116

117-
/* check interlace */
118-
if (s->ops.interlaced) {
119-
if (!(rfc8331->f & 0x2)) {
120-
s->stat_pkts_wrong_interlace_dropped++;
121-
return -EINVAL;
122-
}
117+
/* Drop if F is 0b01 (invalid: bit 0 set, bit 1 clear) */
118+
if ((rfc8331->f & 0x3) == 0x1) {
119+
s->stat_pkts_wrong_interlace_dropped++;
120+
return -EINVAL;
121+
}
122+
/* 0b10: first field (bit 1 set, bit 0 clear)
123+
0b11: second field (bit 1 set, bit 0 set) */
124+
if (rfc8331->f & 0x2) {
123125
if (rfc8331->f & 0x1)
124126
s->stat_interlace_second_field++;
125127
else
126128
s->stat_interlace_first_field++;
127-
} else {
128-
if (rfc8331->f) {
129-
s->stat_pkts_wrong_interlace_dropped++;
130-
return -EINVAL;
131-
}
132129
}
130+
/* 0b00: progressive or not specified, do nothing */
133131

134132
/* set if it is first pkt */
135133
if (unlikely(s->latest_seq_id == -1)) s->latest_seq_id = seq_id - 1;

0 commit comments

Comments
 (0)