summaryrefslogtreecommitdiffstats
path: root/sys/netinet/raw_ip.c
diff options
context:
space:
mode:
authorhsu <hsu@FreeBSD.org>2003-01-18 01:10:55 +0000
committerhsu <hsu@FreeBSD.org>2003-01-18 01:10:55 +0000
commit87253daee0145d364ad2aaf597ba34c1bee3e68e (patch)
treed89c75522d75252037e8467512ae4dc1c5e34e13 /sys/netinet/raw_ip.c
parent313906579717e981bc1fda675794b9f142b43e51 (diff)
downloadFreeBSD-src-87253daee0145d364ad2aaf597ba34c1bee3e68e.zip
FreeBSD-src-87253daee0145d364ad2aaf597ba34c1bee3e68e.tar.gz
Fix long-standing bug predating FreeBSD where calling connect() twice
on a raw ip socket will crash the system with a null-dereference.
Diffstat (limited to 'sys/netinet/raw_ip.c')
-rw-r--r--sys/netinet/raw_ip.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 8599a1b..3c37fc4 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -581,7 +581,9 @@ static int
rip_abort(struct socket *so)
{
soisdisconnected(so);
- return rip_detach(so);
+ if (so->so_state & SS_NOFDREF)
+ return rip_detach(so);
+ return 0;
}
static int
OpenPOWER on IntegriCloud