[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <783609149.3265072.1371741133384.JavaMail.root@vmware.com>
Date: Thu, 20 Jun 2013 08:12:13 -0700 (PDT)
From: Andy King <acking@...are.com>
To: Asias He <asias@...hat.com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Dmitry Torokhov <dtor@...are.com>,
Reilly Grant <grantr@...are.com>
Subject: Re: [PATCH 4/4] VSOCK: Fix VSOCK_HASH and VSOCK_CONN_HASH
> If we mod with VSOCK_HASH_SIZE -1, we get 0, 1, .... 249. Actually, we
> have vsock_bind_table[0 ... 250] and vsock_connected_table[0 .. 250].
> In this case the last entry will never be used.
If I remember correctly, we did this on purpose. There's actually a
comment about it:
> * VSOCK_HASH_SIZE + 1 so that vsock_bind_table[0] through
> * vsock_bind_table[VSOCK_HASH_SIZE - 1] are for bound sockets and
> * vsock_bind_table[VSOCK_HASH_SIZE] is for unbound sockets. The hash
[250] is for unbound sockets. If you hash on that, you'll mistakenly
get an unbound socket when looking for a bound one.
It is confusing, so perhaps a better way is just to move unbound into
its own table.
Thanks!
- Andy
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists