Skip to content

Commit ebfba8f

Browse files
Fix: ST40/ST41 first packet timestamp
Packet timestamps were only calculated when the RTP time differed from the previous frame, which failed for the initial packet. This caused the first TX packet to be transmitted with timestamp 0, resulting in DDoS-like behavior on the RX side. During initalization make the session calculate the timestamp to avoid such issues. To test set the date into problematic clock area sudo date -s "2025-10-29 17:28:30"
1 parent 74d8f92 commit ebfba8f

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

lib/src/st2110/st_header.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ struct st_rx_ancillary_session_impl {
11901190

11911191
struct mt_rtcp_rx* rtcp_rx[MTL_SESSION_PORT_MAX];
11921192

1193-
uint32_t tmstamp;
1193+
int64_t tmstamp;
11941194
/* status */
11951195
rte_atomic32_t stat_frames_received;
11961196
int stat_pkts_dropped;
@@ -1363,7 +1363,8 @@ struct st_rx_fastmetadata_session_impl {
13631363

13641364
struct mt_rtcp_rx* rtcp_rx[MTL_SESSION_PORT_MAX];
13651365

1366-
uint32_t tmstamp;
1366+
/* the timestamp */
1367+
int64_t tmstamp;
13671368
/* status */
13681369
rte_atomic32_t stat_frames_received;
13691370
int stat_pkts_redundant;

lib/src/st2110/st_rx_ancillary_session.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ static int rx_ancillary_session_handle_pkt(struct mtl_main_impl* impl,
152152
dbg("%s(%d,%d), redundant seq now %u session last %d\n", __func__, s->idx, s_port,
153153
seq_id, s->session_seq_id);
154154
} else {
155-
dbg("%s(%d,%d), redundant tmstamp now %u session last %u\n", __func__, s->idx,
155+
dbg("%s(%d,%d), redundant tmstamp now %u session last %ld\n", __func__, s->idx,
156156
s_port, tmstamp, s->tmstamp);
157157
}
158158

lib/src/st2110/st_rx_fastmetadata_session.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static int rx_fastmetadata_session_handle_pkt(struct mtl_main_impl* impl,
135135
dbg("%s(%d,%d), redundant seq now %u session last %d\n", __func__, s->idx, s_port,
136136
seq_id, s->session_seq_id);
137137
} else {
138-
dbg("%s(%d,%d), redundant tmstamp now %u session last %u\n", __func__, s->idx,
138+
dbg("%s(%d,%d), redundant tmstamp now %u session last %ld\n", __func__, s->idx,
139139
s_port, tmstamp, s->tmstamp);
140140
}
141141

lib/src/st2110/st_tx_ancillary_session.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,7 @@ static int tx_ancillary_session_attach(struct mtl_main_impl* impl,
15741574
return ret;
15751575
}
15761576

1577+
s->calculate_time_cursor = true;
15771578
ret = tx_ancillary_session_init_pacing(s);
15781579
if (ret < 0) {
15791580
err("%s(%d), init pacing fail %d\n", __func__, idx, ret);

lib/src/st2110/st_tx_fastmetadata_session.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,6 +1495,7 @@ static int tx_fastmetadata_session_attach(struct mtl_main_impl* impl,
14951495
return ret;
14961496
}
14971497

1498+
s->calculate_time_cursor = true;
14981499
ret = tx_fastmetadata_session_init_pacing(s);
14991500
if (ret < 0) {
15001501
err("%s(%d), init pacing fail %d\n", __func__, idx, ret);

0 commit comments

Comments
 (0)