Source-Changes-HG archive

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

[src/trunk]: src/sys Don't call soroverflow when we return the error to the s...



details:   https://anonhg.NetBSD.org/src/rev/b4aab546ed6b
branches:  trunk
changeset: 994439:b4aab546ed6b
user:      roy <roy%NetBSD.org@localhost>
date:      Thu Nov 08 04:30:37 2018 +0000

description:
Don't call soroverflow when we return the error to the sender.

Thanks to thorpej@ for a sanity check.

diffstat:

 sys/kern/uipc_usrreq.c |  12 +++++++-----
 sys/netipsec/keysock.c |   8 +++++---
 2 files changed, 12 insertions(+), 8 deletions(-)

diffs (64 lines):

diff -r 23d24e1af129 -r b4aab546ed6b sys/kern/uipc_usrreq.c
--- a/sys/kern/uipc_usrreq.c    Thu Nov 08 04:05:10 2018 +0000
+++ b/sys/kern/uipc_usrreq.c    Thu Nov 08 04:30:37 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_usrreq.c,v 1.186 2018/05/11 09:43:59 roy Exp $    */
+/*     $NetBSD: uipc_usrreq.c,v 1.187 2018/11/08 04:30:37 roy Exp $    */
 
 /*-
  * Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.186 2018/05/11 09:43:59 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.187 2018/11/08 04:30:37 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -345,11 +345,13 @@
                unp_dispose(control);
                m_freem(control);
                m_freem(m);
-               soroverflow(so2);
-               return (ENOBUFS);
+               /* Don't call soroverflow because we're returning this
+                * error directly to the sender. */
+               so2->so_rcv.sb_overflowed++;
+               return ENOBUFS;
        } else {
                sorwakeup(so2);
-               return (0);
+               return 0;
        }
 }
 
diff -r 23d24e1af129 -r b4aab546ed6b sys/netipsec/keysock.c
--- a/sys/netipsec/keysock.c    Thu Nov 08 04:05:10 2018 +0000
+++ b/sys/netipsec/keysock.c    Thu Nov 08 04:30:37 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: keysock.c,v 1.65 2018/04/26 19:50:09 maxv Exp $        */
+/*     $NetBSD: keysock.c,v 1.66 2018/11/08 04:30:38 roy Exp $ */
 /*     $FreeBSD: keysock.c,v 1.3.2.1 2003/01/24 05:11:36 sam Exp $     */
 /*     $KAME: keysock.c,v 1.25 2001/08/13 20:07:41 itojun Exp $        */
 
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: keysock.c,v 1.65 2018/04/26 19:50:09 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: keysock.c,v 1.66 2018/11/08 04:30:38 roy Exp $");
 
 /* This code has derived from sys/net/rtsock.c on FreeBSD2.2.5 */
 
@@ -207,7 +207,9 @@
                    __func__);
                PFKEY_STATINC(PFKEY_STAT_IN_NOMEM);
                m_freem(m);
-               soroverflow(rp->rcb_socket);
+               /* Don't call soroverflow because we're returning this
+                * error directly to the sender. */
+               rp->rcb_socket->so_rcv.sb_overflowed++;
                error = ENOBUFS;
        } else {
                sorwakeup(rp->rcb_socket);



Home | Main Index | Thread Index | Old Index