Date: Sat, 21 May 2011 23:30:00 +0100 (BST) From: Robert Watson <rwatson@FreeBSD.org> To: Luigi Rizzo <luigi@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215178 - in head: lib/libc/sys sys/kern sys/sys Message-ID: <alpine.BSF.2.00.1105212327440.35370@fledge.watson.org> In-Reply-To: <201011121302.oACD2Qjt009385@svn.freebsd.org> References: <201011121302.oACD2Qjt009385@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1105212327440.35370>