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

Function tcp_drop

freebsd/netinet/tcp_subr.c:1893–1912  ·  view source on GitHub ↗

* Drop a TCP connection, reporting * the specified error. If connection is synchronized, * then send a RST to peer. */

Source from the content-addressed store, hash-verified

1891 * then send a RST to peer.
1892 */
1893struct tcpcb *
1894tcp_drop(struct tcpcb *tp, int errno)
1895{
1896 struct socket *so = tp->t_inpcb->inp_socket;
1897
1898 NET_EPOCH_ASSERT();
1899 INP_INFO_LOCK_ASSERT(&V_tcbinfo);
1900 INP_WLOCK_ASSERT(tp->t_inpcb);
1901
1902 if (TCPS_HAVERCVDSYN(tp->t_state)) {
1903 tcp_state_change(tp, TCPS_CLOSED);
1904 (void) tp->t_fb->tfb_tcp_output(tp);
1905 TCPSTAT_INC(tcps_drops);
1906 } else
1907 TCPSTAT_INC(tcps_conndrops);
1908 if (errno == ETIMEDOUT && tp->t_softerror)
1909 errno = tp->t_softerror;
1910 so->so_error = errno;
1911 return (tcp_close(tp));
1912}
1913
1914void
1915tcp_discardcb(struct tcpcb *tp)

Callers 15

tcp_timer_keepFunction · 0.85
tcp_timer_persistFunction · 0.85
tcp_timer_rexmtFunction · 0.85
tcp_do_segmentFunction · 0.85
tcp_input_dataFunction · 0.85
tcp_notifyFunction · 0.85
tcp_drop_syn_sentFunction · 0.85
sysctl_dropFunction · 0.85
toe_connect_failedFunction · 0.85
tcp_usr_abortFunction · 0.85
tcp_disconnectFunction · 0.85
ctf_challenge_ackFunction · 0.85

Calls 2

tcp_state_changeFunction · 0.85
tcp_closeFunction · 0.85

Tested by

no test coverage detected