Source-Changes-HG archive

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

[src/netbsd-7-1]: src/sys/net Apply patch, requested by sborrill in ticket #1...



details:   https://anonhg.NetBSD.org/src/rev/2d53ffdfa53c
branches:  netbsd-7-1
changeset: 449106:2d53ffdfa53c
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Feb 23 07:16:37 2019 +0000

description:
Apply patch, requested by sborrill in ticket #1680:

        sys/net/rtsock.c                (apply patch)

Fix locking for sysctl_rtable (fix in HEAD will be different).

diffstat:

 sys/net/rtsock.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r fe4ef6f1817f -r 2d53ffdfa53c sys/net/rtsock.c
--- a/sys/net/rtsock.c  Sat Feb 23 07:04:11 2019 +0000
+++ b/sys/net/rtsock.c  Sat Feb 23 07:16:37 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtsock.c,v 1.163.8.1 2018/11/28 16:30:57 martin Exp $  */
+/*     $NetBSD: rtsock.c,v 1.163.8.2 2019/02/23 07:16:37 martin Exp $  */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.163.8.1 2018/11/28 16:30:57 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.163.8.2 2019/02/23 07:16:37 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1408,6 +1408,8 @@
        w.w_needed = 0 - w.w_given;
        w.w_where = where;
 
+       mutex_enter(softnet_lock);
+       KERNEL_LOCK(1, NULL);
        s = splsoftnet();
        switch (w.w_op) {
 
@@ -1434,6 +1436,8 @@
                break;
        }
        splx(s);
+       KERNEL_UNLOCK_ONE(NULL);
+       mutex_exit(softnet_lock);
 
        /* check to see if we couldn't allocate memory with NOWAIT */
        if (error == ENOBUFS && w.w_tmem == 0 && w.w_tmemneeded)



Home | Main Index | Thread Index | Old Index