Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Sep 2014 21:54:11 +0200
From:      Mateusz Guzik <mjguzik@gmail.com>
To:        Gleb Smirnoff <glebius@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r271182 - head/sys/kern
Message-ID:  <20140905195410.GA722@dft-labs.eu>
In-Reply-To: <201409051950.s85JoI3r000416@svn.freebsd.org>
References:  <201409051950.s85JoI3r000416@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Sep 05, 2014 at 07:50:18PM +0000, Gleb Smirnoff wrote:
> 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();
>  	

should not this be something like:
		error = hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD);
		CURVNET_RESTORE();
		return (error);
?

>  	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;
> 

-- 
Mateusz Guzik <mjguzik gmail.com>



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