From ff371b3b33e435f63962615be06404f6f8af3d5e Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Mon, 19 Sep 2011 11:36:35 +0200 Subject: erts: Fix bug SCTP send can only be called from controlling process Conflicts: lib/kernel/test/gen_sctp_SUITE.erl --- erts/emulator/drivers/common/inet_drv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'erts') diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c index c6e23ee647..3c4be8eea4 100644 --- a/erts/emulator/drivers/common/inet_drv.c +++ b/erts/emulator/drivers/common/inet_drv.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1997-2009. All Rights Reserved. + * Copyright Ericsson AB 1997-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -6425,8 +6425,7 @@ static int sctp_fill_opts(inet_descriptor* desc, char* buf, int buflen, i = LOAD_TUPLE(spec, i, 3); /* Now, convert "spec" into the returnable term: */ - /* desc->caller = 0; What does it mean? */ - driver_output_term(desc->port, spec, i); + driver_send_term(desc->port, driver_caller(desc->port), spec, i); FREE(spec); (*dest)[0] = INET_REP_SCTP; -- cgit v1.2.3 From 0159f7a9598c1d88b2e184dcc442c254ef8f14c9 Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Mon, 19 Sep 2011 12:10:46 +0200 Subject: erts,kernel: Bugfix - read SCTP socket options from right protocol layer Socket options 'sndbuf', 'recbuf' and 'linger were read from the SCTP protocol layer instead of from the socket protocol layer. Conflicts: lib/kernel/test/gen_sctp_SUITE.erl --- erts/emulator/drivers/common/inet_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'erts') diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c index 3c4be8eea4..2bff5bd4f7 100644 --- a/erts/emulator/drivers/common/inet_drv.c +++ b/erts/emulator/drivers/common/inet_drv.c @@ -5941,7 +5941,7 @@ static int sctp_fill_opts(inet_descriptor* desc, char* buf, int buflen, struct linger lg; unsigned int sz = sizeof(lg); - if (sock_getopt(desc->s, IPPROTO_SCTP, SO_LINGER, + if (sock_getopt(desc->s, SOL_SOCKET, SO_LINGER, &lg, &sz) < 0) continue; /* Fill in the response: */ PLACE_FOR(spec, i, @@ -5977,7 +5977,7 @@ static int sctp_fill_opts(inet_descriptor* desc, char* buf, int buflen, { case INET_OPT_RCVBUF : { - proto = IPPROTO_SCTP; + proto = SOL_SOCKET; type = SO_RCVBUF; is_int = 1; tag = am_recbuf; @@ -5985,7 +5985,7 @@ static int sctp_fill_opts(inet_descriptor* desc, char* buf, int buflen, } case INET_OPT_SNDBUF : { - proto = IPPROTO_SCTP; + proto = SOL_SOCKET; type = SO_SNDBUF; is_int = 1; tag = am_sndbuf; -- cgit v1.2.3