Skip to content

Commit

Permalink
Allow SCTP chunks which has padding not filled with zeros
Browse files Browse the repository at this point in the history
  • Loading branch information
ates committed Feb 10, 2014
1 parent 805bdcc commit 87d90b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pkt_sctp.erl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ decode_chunks(<<Type:8, Flags:8, Length:16, Rest/binary>>, Acc) ->
N when N =< 3 -> % pad should be no more than 3 bytes
{Length - 4, (4 - N) * 8}
end,
<<Payload:L/binary-unit:8, 0:Pad, Tail/binary>> = Rest,
<<Payload:L/binary-unit:8, _:Pad, Tail/binary>> = Rest,
decode_chunks(Tail, [chunk(Type, Flags, Length, Payload) | Acc]);
%% Ignore other bytes which are not SCTP chunks (VSS, ...)
decode_chunks(Other, Acc) -> {Acc, Other}.
Expand Down

0 comments on commit 87d90b5

Please sign in to comment.