aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2011-09-19 15:28:40 +0200
committerAnders Svensson <[email protected]>2011-09-19 15:28:40 +0200
commite84f232326b2800ca806c867b2bfbe3652d423cb (patch)
tree1d4d325e58e6e3fbe890eb64d1752dc5672cec10
parent692772c8e238d66eb054faba5dd0fba4bacf3a2f (diff)
parentc7958e546c0c886f47a3075f7117a1cc59fe9fcc (diff)
downloadotp-e84f232326b2800ca806c867b2bfbe3652d423cb.tar.gz
otp-e84f232326b2800ca806c867b2bfbe3652d423cb.tar.bz2
otp-e84f232326b2800ca806c867b2bfbe3652d423cb.zip
Merge branch 'anders/diameter/unhandled_gen_sctp_events/OTP-9538' into dev
* anders/diameter/unhandled_gen_sctp_events/OTP-9538: Handle #sctp_paddr_change and #sctp_pdapi_event from gen_sctp.
-rw-r--r--lib/diameter/src/transport/diameter_sctp.erl19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/diameter/src/transport/diameter_sctp.erl b/lib/diameter/src/transport/diameter_sctp.erl
index 92aa8488a0..46473e7bf1 100644
--- a/lib/diameter/src/transport/diameter_sctp.erl
+++ b/lib/diameter/src/transport/diameter_sctp.erl
@@ -525,7 +525,22 @@ recv({[#sctp_sndrcvinfo{stream = Id}], Bin}, #transport{parent = Pid})
recv({[], #sctp_shutdown_event{assoc_id = Id}},
#transport{assoc_id = Id}) ->
- stop.
+ stop;
+
+%% Note that diameter_sctp(3) documents that sctp_events cannot be
+%% specified in the list of options passed to gen_sctp and that
+%% gen_opts/1 guards against this. This is to ensure that we know what
+%% events to expect and also to ensure that we receive
+%% #sctp_sndrcvinfo{} with each incoming message (data_io_event =
+%% true). Adaptation layer events (ie. #sctp_adaptation_event{}) are
+%% disabled by default so don't handle it. We could simply disable
+%% events we don't react to but don't.
+
+recv({[], #sctp_paddr_change{}}, _) ->
+ ok;
+
+recv({[], #sctp_pdapi_event{}}, _) ->
+ ok.
%% up/1
@@ -591,7 +606,7 @@ f([], _, _) ->
%% assoc_id/1
-assoc_id(#sctp_shutdown_event{assoc_id = Id}) -> %% undocumented
+assoc_id(#sctp_shutdown_event{assoc_id = Id}) ->
Id;
assoc_id(#sctp_assoc_change{assoc_id = Id}) ->
Id;