o In rip_disconnect() do not call rip_abort(), just mark a socket

as not connected.  In soclose() case rip_detach() will kill inpcb for
us later.

It makes rawconnect regression test do not panic a system.

Reviewed by:	rwatson
X-MFC after:	with all 1th April inpcb changes
This commit is contained in:
Maxim Konovalov 2006-05-15 09:28:57 +00:00
parent df2e45f7c2
commit eb16472f74

View File

@ -661,9 +661,19 @@ rip_abort(struct socket *so)
static int
rip_disconnect(struct socket *so)
{
struct inpcb *inp;
if ((so->so_state & SS_ISCONNECTED) == 0)
return ENOTCONN;
rip_abort(so);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("rip_disconnect: inp == NULL"));
INP_INFO_WLOCK(&ripcbinfo);
INP_LOCK(inp);
inp->inp_faddr.s_addr = INADDR_ANY;
INP_UNLOCK(inp);
INP_INFO_WUNLOCK(&ripcbinfo);
so->so_state &= ~SS_ISCONNECTED;
return (0);
}