diff options
author | 2004-04-26 18:16:09 +0000 | |
---|---|---|
committer | 2004-04-26 18:16:09 +0000 | |
commit | 8acc4d06c9ecc9efe1ffc6f02285a1eb127d73b3 (patch) | |
tree | d4fac11651bd90fee720cf5d31df3f272860ec58 /sys/netinet/tcp_usrreq.c | |
parent | - allow the user to force the TCP mss below the fail-safe 216 with a low (diff) | |
download | wireguard-openbsd-8acc4d06c9ecc9efe1ffc6f02285a1eb127d73b3.tar.xz wireguard-openbsd-8acc4d06c9ecc9efe1ffc6f02285a1eb127d73b3.zip |
change tcpdrop to require newp instead of oldp; suggested by otto
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index abafe056ef2..496f261dfe6 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_usrreq.c,v 1.83 2004/04/25 04:34:05 markus Exp $ */ +/* $OpenBSD: tcp_usrreq.c,v 1.84 2004/04/26 18:16:09 markus Exp $ */ /* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */ /* @@ -790,22 +790,23 @@ 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) { - /* - * XXX stupid permission hack: - * only root may set newp, so we require newp for tcp_drop() - */ if (newp == NULL) return (EPERM); - } else if (newp != NULL || newlen != 0) - return (EINVAL); - if (*oldlenp < sizeof(tir)) - return (ENOMEM); - if ((error = copyin(oldp, &tir, sizeof (tir))) != 0 ) - return (error); + if (newlen < sizeof(tir)) + return (ENOMEM); + if ((error = copyin(newp, &tir, sizeof (tir))) != 0 ) + return (error); + } else { + if (newp != NULL || newlen != 0) + return (EINVAL); + if ((error = copyin(oldp, &tir, sizeof (tir))) != 0 ) + return (error); + } switch (tir.faddr.ss_family) { #ifdef INET6 case AF_INET6: |