Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys disallow negative numbers for ratelimit interval (tcp, i...



details:   https://anonhg.NetBSD.org/src/rev/8abcbcc23b7c
branches:  trunk
changeset: 486438:8abcbcc23b7c
user:      itojun <itojun%NetBSD.org@localhost>
date:      Mon May 22 12:08:43 2000 +0000

description:
disallow negative numbers for ratelimit interval (tcp, icmp, icmp6).

diffstat:

 sys/netinet/ip_icmp.c    |  4 +++-
 sys/netinet/tcp_usrreq.c |  4 +++-
 sys/netinet6/icmp6.c     |  4 +++-
 3 files changed, 9 insertions(+), 3 deletions(-)

diffs (54 lines):

diff -r 701a7c3e79c5 -r 8abcbcc23b7c sys/netinet/ip_icmp.c
--- a/sys/netinet/ip_icmp.c     Mon May 22 11:46:07 2000 +0000
+++ b/sys/netinet/ip_icmp.c     Mon May 22 12:08:43 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_icmp.c,v 1.45 2000/05/10 03:31:30 itojun Exp $      */
+/*     $NetBSD: ip_icmp.c,v 1.46 2000/05/22 12:08:43 itojun Exp $      */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -816,6 +816,8 @@
                error = sysctl_int(oldp, oldlenp, newp, newlen, &rate_usec);
                if (error)
                        return (error);
+               if (rate_usec < 0)
+                       return (EINVAL);
                s = splsoftnet();
                icmperrratelim.tv_sec = rate_usec / 1000000;
                icmperrratelim.tv_usec = rate_usec % 1000000;
diff -r 701a7c3e79c5 -r 8abcbcc23b7c sys/netinet/tcp_usrreq.c
--- a/sys/netinet/tcp_usrreq.c  Mon May 22 11:46:07 2000 +0000
+++ b/sys/netinet/tcp_usrreq.c  Mon May 22 12:08:43 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_usrreq.c,v 1.49 2000/03/30 13:25:10 augustss Exp $ */
+/*     $NetBSD: tcp_usrreq.c,v 1.50 2000/05/22 12:08:43 itojun Exp $   */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -913,6 +913,8 @@
                error = sysctl_int(oldp, oldlenp, newp, newlen, &rate_usec);
                if (error)
                        return (error);
+               if (rate_usec < 0)
+                       return (EINVAL);
                s = splsoftnet();
                tcp_rst_ratelim.tv_sec = rate_usec / 1000000;
                tcp_rst_ratelim.tv_usec = rate_usec % 1000000;
diff -r 701a7c3e79c5 -r 8abcbcc23b7c sys/netinet6/icmp6.c
--- a/sys/netinet6/icmp6.c      Mon May 22 11:46:07 2000 +0000
+++ b/sys/netinet6/icmp6.c      Mon May 22 12:08:43 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: icmp6.c,v 1.29 2000/05/09 11:51:12 itojun Exp $        */
+/*     $NetBSD: icmp6.c,v 1.30 2000/05/22 12:08:44 itojun Exp $        */
 /*     $KAME: icmp6.c,v 1.82 2000/05/05 13:27:14 sumikawa Exp $        */
 
 /*
@@ -2257,6 +2257,8 @@
                error = sysctl_int(oldp, oldlenp, newp, newlen, &rate_usec);
                if (error)
                        return (error);
+               if (rate_usec < 0)
+                       return (EINVAL);
                s = splsoftnet();
                icmp6errratelim.tv_sec = rate_usec / 1000000;
                icmp6errratelim.tv_usec = rate_usec % 1000000;



Home | Main Index | Thread Index | Old Index