When converting soft error into a hard error, drop the connection. The
error will be passed up to the user, who will close the connection, so it does not appear to make a sense to leave the connection open. This also fixes a bug with kqueue, where the filter does not set EOF on the connection, because the connection is still open. Also remove calls to so{rw}wakeup, as we aren't doing anything with them at the moment anyway. Reviewed by: alfred, jesper
This commit is contained in:
parent
e4bb5b0572
commit
c484d1a38c
@ -752,14 +752,16 @@ tcp_drain()
|
||||
* Notify a tcp user of an asynchronous error;
|
||||
* store error as soft error, but wake up user
|
||||
* (for now, won't do anything until can select for soft error).
|
||||
*
|
||||
* Do not wake up user since there currently is no mechanism for
|
||||
* reporting soft errors (yet - a kqueue filter may be added).
|
||||
*/
|
||||
static void
|
||||
tcp_notify(inp, error)
|
||||
struct inpcb *inp;
|
||||
int error;
|
||||
{
|
||||
register struct tcpcb *tp = (struct tcpcb *)inp->inp_ppcb;
|
||||
register struct socket *so = inp->inp_socket;
|
||||
struct tcpcb *tp = (struct tcpcb *)inp->inp_ppcb;
|
||||
|
||||
/*
|
||||
* Ignore some errors if we are hooked up.
|
||||
@ -774,12 +776,14 @@ tcp_notify(inp, error)
|
||||
return;
|
||||
} else if (tp->t_state < TCPS_ESTABLISHED && tp->t_rxtshift > 3 &&
|
||||
tp->t_softerror)
|
||||
so->so_error = error;
|
||||
tcp_drop(tp, error);
|
||||
else
|
||||
tp->t_softerror = error;
|
||||
#if 0
|
||||
wakeup((caddr_t) &so->so_timeo);
|
||||
sorwakeup(so);
|
||||
sowwakeup(so);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -752,14 +752,16 @@ tcp_drain()
|
||||
* Notify a tcp user of an asynchronous error;
|
||||
* store error as soft error, but wake up user
|
||||
* (for now, won't do anything until can select for soft error).
|
||||
*
|
||||
* Do not wake up user since there currently is no mechanism for
|
||||
* reporting soft errors (yet - a kqueue filter may be added).
|
||||
*/
|
||||
static void
|
||||
tcp_notify(inp, error)
|
||||
struct inpcb *inp;
|
||||
int error;
|
||||
{
|
||||
register struct tcpcb *tp = (struct tcpcb *)inp->inp_ppcb;
|
||||
register struct socket *so = inp->inp_socket;
|
||||
struct tcpcb *tp = (struct tcpcb *)inp->inp_ppcb;
|
||||
|
||||
/*
|
||||
* Ignore some errors if we are hooked up.
|
||||
@ -774,12 +776,14 @@ tcp_notify(inp, error)
|
||||
return;
|
||||
} else if (tp->t_state < TCPS_ESTABLISHED && tp->t_rxtshift > 3 &&
|
||||
tp->t_softerror)
|
||||
so->so_error = error;
|
||||
tcp_drop(tp, error);
|
||||
else
|
||||
tp->t_softerror = error;
|
||||
#if 0
|
||||
wakeup((caddr_t) &so->so_timeo);
|
||||
sorwakeup(so);
|
||||
sowwakeup(so);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user