MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tcp_usr_ready

Function tcp_usr_ready

freebsd/netinet/tcp_usrreq.c:1349–1377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1347}
1348
1349static int
1350tcp_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.

Callers

nothing calls this directly

Calls 2

mb_free_notreadyFunction · 0.85
sbreadyFunction · 0.85

Tested by

no test coverage detected