Skip to content

Commit 548f8f1

Browse files
fix wrong assert
1 parent 1fd34e7 commit 548f8f1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

libudpard/udpard.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,14 +1263,14 @@ static void tx_promote_staged_transfers(udpard_tx_t* const self, const udpard_us
12631263
while (true) { // we can use next_greater instead of doing min search every time
12641264
tx_transfer_t* const tr = CAVL2_TO_OWNER(cavl2_min(self->index_staged), tx_transfer_t, index_staged);
12651265
if ((tr != NULL) && (now >= tr->staged_until)) {
1266-
UDPARD_ASSERT(tr->cursor != NULL); // cannot stage without payload, doesn't make sense
12671266
// Reinsert into the staged index at the new position, when the next attempt is due (if any).
12681267
cavl2_remove(&self->index_staged, &tr->index_staged);
12691268
tx_stage_if(self, tr);
12701269
// Enqueue for transmission unless it's been there since the last attempt (stalled interface?)
12711270
for (size_t i = 0; i < UDPARD_IFACE_COUNT_MAX; i++) {
1272-
UDPARD_ASSERT(tr->cursor[i] == tr->head[i]);
12731271
if (((tr->iface_bitmap & (1U << i)) != 0) && !is_listed(&self->queue[i][tr->priority], &tr->queue[i])) {
1272+
UDPARD_ASSERT(tr->head[i] != NULL); // cannot stage without payload, doesn't make sense
1273+
UDPARD_ASSERT(tr->cursor[i] == tr->head[i]); // must have been rewound after last attempt
12741274
enlist_head(&self->queue[i][tr->priority], &tr->queue[i]);
12751275
}
12761276
}

0 commit comments

Comments
 (0)