Commit 21eb633
nbd: Reject unconnected sockets in nbd_get_socket().
NBD requires a handshake, so passing unconnected or half-closed
sockets to NBD does not make sense.
Let's accept TCP_ESTABLISHED sockets only.
Note that AF_UNIX sockets remain in TCP_ESTABLISHED once connect()ed
regardless of shutdown(), but this is a prep patch for TCP, allowing
a subsequent patch to call tcp_sendmsg_locked() directly without extra
setup (e.g. inet_send_prepare()).
Signed-off-by: Kuniyuki Iwashima <[email protected]>1 parent 82919fa commit 21eb633
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1228 | 1228 | | |
1229 | 1229 | | |
1230 | 1230 | | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
1231 | 1238 | | |
1232 | 1239 | | |
1233 | 1240 | | |
| |||
0 commit comments