tcp_sysctl_info(__unused struct sysctl_oid *oidp, __unused void *arg1, __unused int arg2, struct sysctl_req *req)
{
int error;
- struct tcp_info ti;
+ struct tcp_info ti = {};
struct info_tuple itpl;
#if !CONFIG_EMBEDDED
proc_t caller = PROC_NULL;
int
tcp_ctloutput(struct socket *so, struct sockopt *sopt)
{
- int error, opt, optval;
+ int error = 0, opt = 0, optval = 0;
struct inpcb *inp;
struct tcpcb *tp;
- error = 0;
inp = sotoinpcb(so);
if (inp == NULL) {
return (ECONNRESET);
goto done;
}
case TCP_MEASURE_BW_BURST: {
- struct tcp_measure_bw_burst out;
+ struct tcp_measure_bw_burst out = {};
if ((tp->t_flagsext & TF_MEASURESNDBW) == 0 ||
tp->t_bwmeas == NULL) {
error = EINVAL;
{
struct socket *so = tp->t_inpcb->inp_socket;
+ if (so->so_rcv.sb_cc != 0 || tp->t_reassqlen != 0)
+ return tcp_drop(tp, 0);
+
if (tp->t_state < TCPS_ESTABLISHED)
tp = tcp_close(tp);
else if ((so->so_options & SO_LINGER) && so->so_linger == 0)