From 87253daee0145d364ad2aaf597ba34c1bee3e68e Mon Sep 17 00:00:00 2001 From: hsu Date: Sat, 18 Jan 2003 01:10:55 +0000 Subject: Fix long-standing bug predating FreeBSD where calling connect() twice on a raw ip socket will crash the system with a null-dereference. --- sys/netinet/raw_ip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/netinet/raw_ip.c') 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 -- cgit v1.1