| 1347 | } |
| 1348 | |
| 1349 | static int |
| 1350 | tcp_usr_ready(struct socket *so, struct mbuf *m, int count) |
| 1351 | { |
| 1352 | struct epoch_tracker et; |
| 1353 | struct inpcb *inp; |
| 1354 | struct tcpcb *tp; |
| 1355 | int error; |
| 1356 | |
| 1357 | inp = sotoinpcb(so); |
| 1358 | INP_WLOCK(inp); |
| 1359 | if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { |
| 1360 | INP_WUNLOCK(inp); |
| 1361 | mb_free_notready(m, count); |
| 1362 | return (ECONNRESET); |
| 1363 | } |
| 1364 | tp = intotcpcb(inp); |
| 1365 | |
| 1366 | SOCKBUF_LOCK(&so->so_snd); |
| 1367 | error = sbready(&so->so_snd, m, count); |
| 1368 | SOCKBUF_UNLOCK(&so->so_snd); |
| 1369 | if (error == 0) { |
| 1370 | NET_EPOCH_ENTER(et); |
| 1371 | error = tp->t_fb->tfb_tcp_output(tp); |
| 1372 | NET_EPOCH_EXIT(et); |
| 1373 | } |
| 1374 | INP_WUNLOCK(inp); |
| 1375 | |
| 1376 | return (error); |
| 1377 | } |
| 1378 | |
| 1379 | /* |
| 1380 | * Abort the TCP. Drop the connection abruptly. |
nothing calls this directly
no test coverage detected