summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authormaxim <maxim@FreeBSD.org>2006-05-15 09:28:57 +0000
committermaxim <maxim@FreeBSD.org>2006-05-15 09:28:57 +0000
commitecfee6862b13ee697c6641d6128f7e0d72715280 (patch)
tree735cd0df99118efce72e0bf06adb5899f587e486 /sys/netinet
parent56aa97312829083666e4cba986a246740269f265 (diff)
downloadFreeBSD-src-ecfee6862b13ee697c6641d6128f7e0d72715280.zip
FreeBSD-src-ecfee6862b13ee697c6641d6128f7e0d72715280.tar.gz
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
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/raw_ip.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 7a7890a..63a6245 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -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);
}
OpenPOWER on IntegriCloud