Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Sep 2014 19:50:18 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r271182 - head/sys/kern
Message-ID:  <201409051950.s85JoI3r000416@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Fri Sep  5 19:50:18 2014
New Revision: 271182
URL: http://svnweb.freebsd.org/changeset/base/271182

Log:
  Set vnet context before accessing V_socket_hhh[].
  
  Submitted by:	"Hiroo Ono (小野寛生)" <hiroo.ono+freebsd gmail.com>

Modified:
  head/sys/kern/uipc_socket.c

Modified: head/sys/kern/uipc_socket.c
==============================================================================
--- head/sys/kern/uipc_socket.c	Fri Sep  5 19:00:30 2014	(r271181)
+++ head/sys/kern/uipc_socket.c	Fri Sep  5 19:50:18 2014	(r271182)
@@ -3265,9 +3265,11 @@ filt_soread(struct knote *kn, long hint)
 			return 1;
 	}
 
+	CURVNET_SET(so->so_vnet);
 	if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0)
 		/* This hook returning non-zero indicates an event, not error */
 		return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD));
+	CURVNET_RESTORE();
 	
 	return (0);
 }
@@ -3294,8 +3296,10 @@ filt_sowrite(struct knote *kn, long hint
 	SOCKBUF_LOCK_ASSERT(&so->so_snd);
 	kn->kn_data = sbspace(&so->so_snd);
 
+	CURVNET_SET(so->so_vnet);
 	if (V_socket_hhh[HHOOK_FILT_SOWRITE]->hhh_nhooks > 0)
 		hhook_run_socket(so, kn, HHOOK_FILT_SOWRITE);
+	CURVNET_RESTORE();
 
 	if (so->so_snd.sb_state & SBS_CANTSENDMORE) {
 		kn->kn_flags |= EV_EOF;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409051950.s85JoI3r000416>