aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/socket.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 1e788279bb22..b1917f68723c 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -980,6 +980,7 @@ static int __sctp_connect(struct sock* sk,
980 union sctp_addr *sa_addr; 980 union sctp_addr *sa_addr;
981 void *addr_buf; 981 void *addr_buf;
982 unsigned short port; 982 unsigned short port;
983 unsigned int f_flags = 0;
983 984
984 sp = sctp_sk(sk); 985 sp = sctp_sk(sk);
985 ep = sp->ep; 986 ep = sp->ep;
@@ -1106,7 +1107,14 @@ static int __sctp_connect(struct sock* sk,
1106 af->to_sk_daddr(&to, sk); 1107 af->to_sk_daddr(&to, sk);
1107 sk->sk_err = 0; 1108 sk->sk_err = 0;
1108 1109
1109 timeo = sock_sndtimeo(sk, sk->sk_socket->file->f_flags & O_NONBLOCK); 1110 /* in-kernel sockets don't generally have a file allocated to them
1111 * if all they do is call sock_create_kern().
1112 */
1113 if (sk->sk_socket->file)
1114 f_flags = sk->sk_socket->file->f_flags;
1115
1116 timeo = sock_sndtimeo(sk, f_flags & O_NONBLOCK);
1117
1110 err = sctp_wait_for_connect(asoc, &timeo); 1118 err = sctp_wait_for_connect(asoc, &timeo);
1111 1119
1112 /* Don't free association on exit. */ 1120 /* Don't free association on exit. */