aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2010-08-25 14:43:49 +0200
committerRaimo Niskanen <[email protected]>2010-08-31 14:21:01 +0200
commiteca2411eb67461bf3cda66d0f981b47698ab99f3 (patch)
treeeef5e45f48e617a49784cfe8a1100b558944e8b1 /erts
parent82d430853eb1f53e6022de647c26254fe5681454 (diff)
downloadotp-eca2411eb67461bf3cda66d0f981b47698ab99f3.tar.gz
otp-eca2411eb67461bf3cda66d0f981b47698ab99f3.tar.bz2
otp-eca2411eb67461bf3cda66d0f981b47698ab99f3.zip
Fill in sinfo_assoc_id in struct sctp_sndrcvinfo for getopt()
The assoc_id field was uninitialized causing random answers.
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/drivers/common/inet_drv.c4
-rw-r--r--erts/preloaded/ebin/prim_inet.beambin57272 -> 57280 bytes
-rw-r--r--erts/preloaded/src/prim_inet.erl2
3 files changed, 5 insertions, 1 deletions
diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c
index 059288d1cb..10cd140cf4 100644
--- a/erts/emulator/drivers/common/inet_drv.c
+++ b/erts/emulator/drivers/common/inet_drv.c
@@ -6193,6 +6193,10 @@ static int sctp_fill_opts(inet_descriptor* desc, char* buf, int buflen,
struct sctp_sndrcvinfo sri;
unsigned int sz = sizeof(sri);
+ if (buflen < ASSOC_ID_LEN) RETURN_ERROR(spec, -EINVAL);
+ sri.sinfo_assoc_id = GET_ASSOC_ID(buf);
+ buf += ASSOC_ID_LEN;
+ buflen -= ASSOC_ID_LEN;
if (sock_getopt(desc->s, IPPROTO_SCTP, SCTP_DEFAULT_SEND_PARAM,
&sri, &sz) < 0) continue;
/* Fill in the response: */
diff --git a/erts/preloaded/ebin/prim_inet.beam b/erts/preloaded/ebin/prim_inet.beam
index ac336c1b2d..71f6643368 100644
--- a/erts/preloaded/ebin/prim_inet.beam
+++ b/erts/preloaded/ebin/prim_inet.beam
Binary files differ
diff --git a/erts/preloaded/src/prim_inet.erl b/erts/preloaded/src/prim_inet.erl
index 0feb591efb..015c693888 100644
--- a/erts/preloaded/src/prim_inet.erl
+++ b/erts/preloaded/src/prim_inet.erl
@@ -1206,7 +1206,7 @@ type_opt_1(sctp_default_send_param) ->
timetolive = [uint32,0],
tsn = [],
cumtsn = [],
- assoc_id = [sctp_assoc_id,0]}}];
+ assoc_id = [[sctp_assoc_id,0]]}}];
%% for SCTP_OPT_EVENTS
type_opt_1(sctp_events) ->
[{record,#sctp_event_subscribe{