summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2004-04-27 17:51:34 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2004-04-27 17:51:34 +0000
commitca53310b12cf861f85d2ed83e2de87631022c4a3 (patch)
tree382af82b2c023b4f6bc426a6a6aa78e9e9de4ee1 /sys/netinet/tcp_usrreq.c
parent52fbe3cb81b06b78796d72ec33a1a6f4507cd440 (diff)
Require NULL oldp when dropping a connection.
ok markus@
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r--sys/netinet/tcp_usrreq.c12
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 )