From owner-svn-src-all@FreeBSD.ORG Sat May 21 22:30:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 412D41065672; Sat, 21 May 2011 22:30:01 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 182E88FC08; Sat, 21 May 2011 22:30:01 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id C1D6A46B2A; Sat, 21 May 2011 18:30:00 -0400 (EDT) Date: Sat, 21 May 2011 23:30:00 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Luigi Rizzo In-Reply-To: <201011121302.oACD2Qjt009385@svn.freebsd.org> Message-ID: References: <201011121302.oACD2Qjt009385@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed 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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2011 22:30:01 -0000 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