Module Name: src Committed By: pooka Date: Sun Aug 15 18:48:39 UTC 2010
Modified Files: src/sys/rump/net/lib/libshmif: if_shmem.c Log Message: Take kernel lock before passing data to if_input. This is in line with IPL_NET interrupts generally not being MPSAFE. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/rump/net/lib/libshmif/if_shmem.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/rump/net/lib/libshmif/if_shmem.c diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.21 src/sys/rump/net/lib/libshmif/if_shmem.c:1.22 --- src/sys/rump/net/lib/libshmif/if_shmem.c:1.21 Sun Aug 15 18:40:41 2010 +++ src/sys/rump/net/lib/libshmif/if_shmem.c Sun Aug 15 18:48:38 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: if_shmem.c,v 1.21 2010/08/15 18:40:41 pooka Exp $ */ +/* $NetBSD: if_shmem.c,v 1.22 2010/08/15 18:48:38 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.21 2010/08/15 18:40:41 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.22 2010/08/15 18:48:38 pooka Exp $"); #include <sys/param.h> #include <sys/atomic.h> @@ -310,7 +310,9 @@ /* if it's from us, don't pass up and reuse storage space */ eth = mtod(m, struct ether_header *); if (memcmp(eth->ether_shost, sc->sc_myaddr, 6) != 0) { + KERNEL_LOCK(1, NULL); ifp->if_input(ifp, m); + KERNEL_UNLOCK_ONE(NULL); m = NULL; } }