diff options
author | Simon Cornish <[email protected]> | 2014-12-02 13:01:54 -0800 |
---|---|---|
committer | Simon Cornish <[email protected]> | 2014-12-08 07:47:23 -0800 |
commit | 6d49fd3d4d66237924912cc6e6ab3d2512fce728 (patch) | |
tree | 38f8ede25c18437d4e7a8db3649b8da048c2ebfd | |
parent | ee17dd99f2a56499b13dc4c84578105ea1f14ff6 (diff) | |
download | otp-6d49fd3d4d66237924912cc6e6ab3d2512fce728.tar.gz otp-6d49fd3d4d66237924912cc6e6ab3d2512fce728.tar.bz2 otp-6d49fd3d4d66237924912cc6e6ab3d2512fce728.zip |
Fix inet:getopts involving #sctp_paddrinfo{}
Handle peer addresses that are unconfirmed (i.e. in state SCTP_UNCONFIRMED).
Handle unknown states instead of using ASSERT
-rw-r--r-- | erts/configure.in | 2 | ||||
-rw-r--r-- | erts/emulator/drivers/common/inet_drv.c | 15 | ||||
-rw-r--r-- | lib/kernel/doc/src/gen_sctp.xml | 2 |
3 files changed, 15 insertions, 4 deletions
diff --git a/erts/configure.in b/erts/configure.in index 1676d3d216..b3fe48d62c 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -1784,7 +1784,7 @@ if test x"$ac_cv_header_netinet_sctp_h" = x"yes"; then AC_CHECK_DECLS([SCTP_UNORDERED, SCTP_ADDR_OVER, SCTP_ABORT, SCTP_EOF, SCTP_SENDALL, SCTP_ADDR_CONFIRMED, SCTP_DELAYED_ACK_TIME, - SCTP_EMPTY, + SCTP_EMPTY, SCTP_UNCONFIRMED, SCTP_CLOSED, SCTPS_IDLE, SCTP_BOUND, SCTPS_BOUND, SCTP_LISTEN, SCTPS_LISTEN, diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c index db8a251fdd..3fe5dac813 100644 --- a/erts/emulator/drivers/common/inet_drv.c +++ b/erts/emulator/drivers/common/inet_drv.c @@ -2890,6 +2890,9 @@ static ErlDrvTermData am_sctp_rtoinfo, /* Option names */ /* For #sctp_paddrinfo{}: */ am_active, am_inactive, +# if HAVE_DECL_SCTP_UNCONFIRMED + am_unconfirmed, +# endif /* For #sctp_status{}: */ # if HAVE_DECL_SCTP_EMPTY @@ -3919,7 +3922,10 @@ static void inet_init_sctp(void) { /* For #sctp_paddrinfo{}: */ INIT_ATOM(active); INIT_ATOM(inactive); - +# if HAVE_DECL_SCTP_UNCONFIRMED + INIT_ATOM(unconfirmed); +# endif + /* For #sctp_status{}: */ # if HAVE_DECL_SCTP_EMPTY INIT_ATOM(empty); @@ -7338,8 +7344,13 @@ static int load_paddrinfo (ErlDrvTermData * spec, int i, case SCTP_INACTIVE: i = LOAD_ATOM (spec, i, am_inactive); break; +# if HAVE_DECL_SCTP_UNCONFIRMED + case SCTP_UNCONFIRMED: + i = LOAD_ATOM (spec, i, am_unconfirmed); + break; +# endif default: - ASSERT(0); /* NB: SCTP_UNCONFIRMED modifier not yet supported */ + i = LOAD_ATOM (spec, i, am_undefined); } i = LOAD_INT (spec, i, pai->spinfo_cwnd); i = LOAD_INT (spec, i, pai->spinfo_srtt); diff --git a/lib/kernel/doc/src/gen_sctp.xml b/lib/kernel/doc/src/gen_sctp.xml index dc9e4766a9..ee8cd441d4 100644 --- a/lib/kernel/doc/src/gen_sctp.xml +++ b/lib/kernel/doc/src/gen_sctp.xml @@ -961,7 +961,7 @@ <pre> #sctp_paddrinfo{ assoc_id = assoc_id(), address = {IP, Port}, - state = inactive | active, + state = inactive | active | unconfirmed, cwnd = integer(), srtt = integer(), rto = integer(), |