Skip to content

Commit

Permalink
fix PFCP sequence number overflow handling
Browse files Browse the repository at this point in the history
The PFCP sequence number needs to wrap arround at 24bits. The encoding
will cut off any excessive bits, but the resulting shorter sequence
number in the request packet will no longer match the internal (expected)
sequence number.
This mean that the answer could net be matched with request, leading
to a break down of communication.
  • Loading branch information
RoadRunnr committed Aug 6, 2019
1 parent ade4a2d commit 4e9d386
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ergw_sx_socket.erl
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ make_send_req(Address, T1, N1, Msg, CbInfo) ->
}.

new_sequence_number(Msg, #state{seq_no = SeqNo} = State) ->
{Msg#pfcp{seq_no = SeqNo}, State#state{seq_no = SeqNo + 1}}.
{Msg#pfcp{seq_no = SeqNo}, State#state{seq_no = (SeqNo + 1) band 16#ffffff}}.

start_request(#send_req{t1 = Timeout, msg = Msg} = SendReq, State) ->
#pfcp{seq_no = SeqNo} = Msg,
Expand Down

0 comments on commit 4e9d386

Please sign in to comment.