Skip to content

Commit

Permalink
Merge pull request #2 from ates/master
Browse files Browse the repository at this point in the history
One more fix related to decoding of SCTP
  • Loading branch information
msantos committed Sep 10, 2012
2 parents ac9ec52 + 8598138 commit 2a8d511
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/pkt.erl
Expand Up @@ -365,8 +365,13 @@ sctp_decode_chunks(<<Type:8, Flags:8, Length:16, Rest/binary>>, Acc) ->
0 -> Length - 4; 0 -> Length - 4;
Pad -> Length + (4 - Pad) - 4 Pad -> Length + (4 - Pad) - 4
end, end,
<<Payload:L/binary-unit:8, Tail/binary>> = Rest, case Rest of
sctp_decode_chunks(Tail, [sctp_chunk(Type, Flags, L, Payload) | Acc]). <<>> ->
Acc;
_ ->
<<Payload:L/binary-unit:8, Tail/binary>> = Rest,
sctp_decode_chunks(Tail, [sctp_chunk(Type, Flags, L, Payload) | Acc])
end.


sctp_chunk(Ctype, Cflags, Clen, Payload) -> sctp_chunk(Ctype, Cflags, Clen, Payload) ->
#sctp_chunk{type=Ctype, flags=Cflags, len = Clen-4, #sctp_chunk{type=Ctype, flags=Cflags, len = Clen-4,
Expand Down

0 comments on commit 2a8d511

Please sign in to comment.