From ca53310b12cf861f85d2ed83e2de87631022c4a3 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Tue, 27 Apr 2004 17:51:34 +0000 Subject: Require NULL oldp when dropping a connection. ok markus@ --- sys/netinet/tcp_usrreq.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'sys/netinet/tcp_usrreq.c') diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 496f261dfe6..45ca4f686dc 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_usrreq.c,v 1.84 2004/04/26 18:16:09 markus Exp $ */ +/* $OpenBSD: tcp_usrreq.c,v 1.85 2004/04/27 17:51:33 otto Exp $ */ /* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */ /* @@ -790,11 +790,9 @@ tcp_ident(oldp, oldlenp, newp, newlen, dodrop) struct sockaddr_in6 *fin6, *lin6; struct in6_addr f6, l6; #endif - if (oldp == NULL) - return (EINVAL); - if (*oldlenp < sizeof(tir)) - return (ENOMEM); if (dodrop) { + if (oldp != NULL || *oldlenp != 0) + return (EINVAL); if (newp == NULL) return (EPERM); if (newlen < sizeof(tir)) @@ -802,6 +800,10 @@ tcp_ident(oldp, oldlenp, newp, newlen, dodrop) if ((error = copyin(newp, &tir, sizeof (tir))) != 0 ) return (error); } else { + if (oldp == NULL) + return (EINVAL); + if (*oldlenp < sizeof(tir)) + return (ENOMEM); if (newp != NULL || newlen != 0) return (EINVAL); if ((error = copyin(oldp, &tir, sizeof (tir))) != 0 ) -- cgit v1.2.3