Source-Changes-HG archive

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

[src/trunk]: src/sys/net - Fix a bug that drop counter shows incorrect vaule ...



details:   https://anonhg.NetBSD.org/src/rev/5013469f55e6
branches:  trunk
changeset: 365272:5013469f55e6
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Aug 10 07:24:09 2018 +0000

description:
- Fix a bug that drop counter shows incorrect vaule like
  "net.inet.ip.ifq.drops = 72059810241052672"
- Change pktq's length sysctl to uint64_t.

diffstat:

 sys/net/if.c       |  6 +++---
 sys/net/pktqueue.c |  7 ++++---
 2 files changed, 7 insertions(+), 6 deletions(-)

diffs (56 lines):

diff -r c41df88a7fa3 -r 5013469f55e6 sys/net/if.c
--- a/sys/net/if.c      Fri Aug 10 07:20:59 2018 +0000
+++ b/sys/net/if.c      Fri Aug 10 07:24:09 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.431 2018/08/06 06:54:40 msaitoh Exp $ */
+/*     $NetBSD: if.c,v 1.432 2018/08/10 07:24:09 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.431 2018/08/06 06:54:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.432 2018/08/10 07:24:09 msaitoh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -3767,7 +3767,7 @@
 
        sysctl_createv(clog, 0, NULL, NULL,
                       CTLFLAG_PERMANENT,
-                      CTLTYPE_INT, "len",
+                      CTLTYPE_QUAD, "len",
                       SYSCTL_DESCR("Current input queue length"),
                       len_func, 0, NULL, 0,
                       CTL_NET, pf, ipn, qid, IFQCTL_LEN, CTL_EOL);
diff -r c41df88a7fa3 -r 5013469f55e6 sys/net/pktqueue.c
--- a/sys/net/pktqueue.c        Fri Aug 10 07:20:59 2018 +0000
+++ b/sys/net/pktqueue.c        Fri Aug 10 07:24:09 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pktqueue.c,v 1.9 2017/06/01 02:45:14 chs Exp $ */
+/*     $NetBSD: pktqueue.c,v 1.10 2018/08/10 07:24:09 msaitoh Exp $    */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pktqueue.c,v 1.9 2017/06/01 02:45:14 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pktqueue.c,v 1.10 2018/08/10 07:24:09 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -381,8 +381,9 @@
 int
 sysctl_pktq_count(SYSCTLFN_ARGS, pktqueue_t *pq, u_int count_id)
 {
-       int count = pktq_get_count(pq, count_id);
+       uint64_t count = pktq_get_count(pq, count_id);
        struct sysctlnode node = *rnode;
+
        node.sysctl_data = &count;
        return sysctl_lookup(SYSCTLFN_CALL(&node));
 }



Home | Main Index | Thread Index | Old Index