svn commit: r215178 - in head: lib/libc/sys sys/kern sys/sys

Robert Watson rwatson at FreeBSD.org
Sat May 21 22:30:01 UTC 2011


On Fri, 12 Nov 2010, Luigi Rizzo wrote:

> Modified: head/sys/sys/socketvar.h
> ==============================================================================
> --- head/sys/sys/socketvar.h	Fri Nov 12 12:48:41 2010	(r215177)
> +++ head/sys/sys/socketvar.h	Fri Nov 12 13:02:26 2010	(r215178)
> @@ -117,7 +117,14 @@ struct socket {
> 		void	*so_accept_filter_arg;	/* saved filter args */
> 		char	*so_accept_filter_str;	/* saved user args */
> 	} *so_accf;
> +	/*
> +	 * so_fibnum, so_user_cookie and friends can be used to attach
> +	 * some user-specified metadata to a socket, which then can be
> +	 * used by the kernel for various actions.
> +	 * so_user_cookie is used by ipfw/dummynet.
> +	 */
> 	int so_fibnum;		/* routing domain for this socket */
> +	uint32_t so_user_cookie;
> };

This seems like it should be an inpcb-layer field, set by an IP-layer socket 
option, not a socket-layer field.  Remember that, in some cases, we have 
inpcb's floating around without sockets, if the socket has been closed but TCP 
is still winding down (such as in TCPS_TIMEWAIT, where we've discarded not 
only the socket, but also the tcpcb, and substituted a tcptw).  In fact, the 
code I pointed at in my previous e-mail will probably panic in that case, 
since it improperly dereferences the inpcb's socket field without first 
testing for NULL.

Robert


More information about the svn-src-all mailing list