diff options
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 12 |
1 files changed, 7 insertions, 5 deletions
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 ) |