diff options
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 2625eccb77d5..aafe94bf292e 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -1603,7 +1603,7 @@ static int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
1603 | sctp_assoc_t associd = 0; | 1603 | sctp_assoc_t associd = 0; |
1604 | sctp_cmsgs_t cmsgs = { NULL }; | 1604 | sctp_cmsgs_t cmsgs = { NULL }; |
1605 | sctp_scope_t scope; | 1605 | sctp_scope_t scope; |
1606 | bool fill_sinfo_ttl = false; | 1606 | bool fill_sinfo_ttl = false, wait_connect = false; |
1607 | struct sctp_datamsg *datamsg; | 1607 | struct sctp_datamsg *datamsg; |
1608 | int msg_flags = msg->msg_flags; | 1608 | int msg_flags = msg->msg_flags; |
1609 | __u16 sinfo_flags = 0; | 1609 | __u16 sinfo_flags = 0; |
@@ -1943,6 +1943,7 @@ static int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
1943 | if (err < 0) | 1943 | if (err < 0) |
1944 | goto out_free; | 1944 | goto out_free; |
1945 | 1945 | ||
1946 | wait_connect = true; | ||
1946 | pr_debug("%s: we associated primitively\n", __func__); | 1947 | pr_debug("%s: we associated primitively\n", __func__); |
1947 | } | 1948 | } |
1948 | 1949 | ||
@@ -1980,6 +1981,11 @@ static int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
1980 | sctp_datamsg_put(datamsg); | 1981 | sctp_datamsg_put(datamsg); |
1981 | err = msg_len; | 1982 | err = msg_len; |
1982 | 1983 | ||
1984 | if (unlikely(wait_connect)) { | ||
1985 | timeo = sock_sndtimeo(sk, msg_flags & MSG_DONTWAIT); | ||
1986 | sctp_wait_for_connect(asoc, &timeo); | ||
1987 | } | ||
1988 | |||
1983 | /* If we are already past ASSOCIATE, the lower | 1989 | /* If we are already past ASSOCIATE, the lower |
1984 | * layers are responsible for association cleanup. | 1990 | * layers are responsible for association cleanup. |
1985 | */ | 1991 | */ |