diff options
Diffstat (limited to 'net/smc/af_smc.c')
-rw-r--r-- | net/smc/af_smc.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index 302e355f2ebc..5b932583e407 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c | |||
@@ -263,7 +263,7 @@ static int smc_bind(struct socket *sock, struct sockaddr *uaddr, | |||
263 | 263 | ||
264 | /* Check if socket is already active */ | 264 | /* Check if socket is already active */ |
265 | rc = -EINVAL; | 265 | rc = -EINVAL; |
266 | if (sk->sk_state != SMC_INIT) | 266 | if (sk->sk_state != SMC_INIT || smc->connect_nonblock) |
267 | goto out_rel; | 267 | goto out_rel; |
268 | 268 | ||
269 | smc->clcsock->sk->sk_reuse = sk->sk_reuse; | 269 | smc->clcsock->sk->sk_reuse = sk->sk_reuse; |
@@ -1390,7 +1390,8 @@ static int smc_listen(struct socket *sock, int backlog) | |||
1390 | lock_sock(sk); | 1390 | lock_sock(sk); |
1391 | 1391 | ||
1392 | rc = -EINVAL; | 1392 | rc = -EINVAL; |
1393 | if ((sk->sk_state != SMC_INIT) && (sk->sk_state != SMC_LISTEN)) | 1393 | if ((sk->sk_state != SMC_INIT && sk->sk_state != SMC_LISTEN) || |
1394 | smc->connect_nonblock) | ||
1394 | goto out; | 1395 | goto out; |
1395 | 1396 | ||
1396 | rc = 0; | 1397 | rc = 0; |
@@ -1518,7 +1519,7 @@ static int smc_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) | |||
1518 | goto out; | 1519 | goto out; |
1519 | 1520 | ||
1520 | if (msg->msg_flags & MSG_FASTOPEN) { | 1521 | if (msg->msg_flags & MSG_FASTOPEN) { |
1521 | if (sk->sk_state == SMC_INIT) { | 1522 | if (sk->sk_state == SMC_INIT && !smc->connect_nonblock) { |
1522 | smc_switch_to_fallback(smc); | 1523 | smc_switch_to_fallback(smc); |
1523 | smc->fallback_rsn = SMC_CLC_DECL_OPTUNSUPP; | 1524 | smc->fallback_rsn = SMC_CLC_DECL_OPTUNSUPP; |
1524 | } else { | 1525 | } else { |
@@ -1732,14 +1733,18 @@ static int smc_setsockopt(struct socket *sock, int level, int optname, | |||
1732 | } | 1733 | } |
1733 | break; | 1734 | break; |
1734 | case TCP_NODELAY: | 1735 | case TCP_NODELAY: |
1735 | if (sk->sk_state != SMC_INIT && sk->sk_state != SMC_LISTEN) { | 1736 | if (sk->sk_state != SMC_INIT && |
1737 | sk->sk_state != SMC_LISTEN && | ||
1738 | sk->sk_state != SMC_CLOSED) { | ||
1736 | if (val && !smc->use_fallback) | 1739 | if (val && !smc->use_fallback) |
1737 | mod_delayed_work(system_wq, &smc->conn.tx_work, | 1740 | mod_delayed_work(system_wq, &smc->conn.tx_work, |
1738 | 0); | 1741 | 0); |
1739 | } | 1742 | } |
1740 | break; | 1743 | break; |
1741 | case TCP_CORK: | 1744 | case TCP_CORK: |
1742 | if (sk->sk_state != SMC_INIT && sk->sk_state != SMC_LISTEN) { | 1745 | if (sk->sk_state != SMC_INIT && |
1746 | sk->sk_state != SMC_LISTEN && | ||
1747 | sk->sk_state != SMC_CLOSED) { | ||
1743 | if (!val && !smc->use_fallback) | 1748 | if (!val && !smc->use_fallback) |
1744 | mod_delayed_work(system_wq, &smc->conn.tx_work, | 1749 | mod_delayed_work(system_wq, &smc->conn.tx_work, |
1745 | 0); | 1750 | 0); |