Skip to content

Commit

Permalink
Fix TCP stitching in the UL direction
Browse files Browse the repository at this point in the history
TCP sequence number offsets were not calculated properly when the
first packet being stitched was originating from the UE.
  • Loading branch information
ivan4th authored and sergeymatov committed Aug 20, 2021
1 parent 18e0e03 commit 2531270
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions upf/upf_proxy_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,12 @@ splice_tcp_connection (upf_main_t * gtm, flow_entry_t * flow,
}

if (flow_seq_offs (flow, origin) == 0)
flow_seq_offs (flow, origin) = tcpRx->rcv_nxt - tcpTx->snd_nxt;
flow_seq_offs (flow, origin) = direction == FT_ORIGIN ?
tcpTx->snd_nxt - tcpRx->rcv_nxt : tcpRx->rcv_nxt - tcpTx->snd_nxt;

if (flow_seq_offs (flow, reverse) == 0)
flow_seq_offs (flow, reverse) = tcpRx->snd_nxt - tcpTx->rcv_nxt;
flow_seq_offs (flow, reverse) = direction == FT_ORIGIN ?
tcpTx->rcv_nxt - tcpRx->snd_nxt : tcpRx->snd_nxt - tcpTx->rcv_nxt;

/* check fifo, proxy Tx/Rx are connected... */
if (svm_fifo_max_dequeue (s->rx_fifo) != 0 ||
Expand Down

0 comments on commit 2531270

Please # to comment.