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
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to