Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet Increment stats when packet is dropped since the...



details:   https://anonhg.NetBSD.org/src/rev/58d3d0e400fa
branches:  trunk
changeset: 553487:58d3d0e400fa
user:      enami <enami%NetBSD.org@localhost>
date:      Fri Oct 17 20:31:12 2003 +0000

description:
Increment stats when packet is dropped since there is no room
to put all fragments in the interfaces's send queue.  Some large
UDP packets are dropped here and administrator may want to bump ifqmaxlen.

diffstat:

 sys/netinet/ip_output.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r f61ccd20bc47 -r 58d3d0e400fa sys/netinet/ip_output.c
--- a/sys/netinet/ip_output.c   Fri Oct 17 20:27:38 2003 +0000
+++ b/sys/netinet/ip_output.c   Fri Oct 17 20:31:12 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_output.c,v 1.125 2003/10/14 06:36:48 itojun Exp $   */
+/*     $NetBSD: ip_output.c,v 1.126 2003/10/17 20:31:12 enami Exp $    */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -98,7 +98,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.125 2003/10/14 06:36:48 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.126 2003/10/17 20:31:12 enami Exp $");
 
 #include "opt_pfil_hooks.h"
 #include "opt_ipsec.h"
@@ -961,8 +961,12 @@
         * any of them.
         */
        s = splnet();
-       if (ifp->if_snd.ifq_maxlen - ifp->if_snd.ifq_len < fragments)
+       if (ifp->if_snd.ifq_maxlen - ifp->if_snd.ifq_len < fragments &&
+           error == 0) {
                error = ENOBUFS;
+               ipstat.ips_odropped++;
+               IFQ_INC_DROPS(&ifp->if_snd);
+       }
        splx(s);
        if (error) {
                for (m = m0; m; m = m0) {



Home | Main Index | Thread Index | Old Index