@@ -90,32 +90,11 @@ struct inet_bind_bucket {
9090 struct hlist_head owners ;
9191};
9292
93- struct inet_bind2_bucket {
94- possible_net_t ib_net ;
95- int l3mdev ;
96- unsigned short port ;
97- union {
98- #if IS_ENABLED (CONFIG_IPV6 )
99- struct in6_addr v6_rcv_saddr ;
100- #endif
101- __be32 rcv_saddr ;
102- };
103- /* Node in the inet2_bind_hashbucket chain */
104- struct hlist_node node ;
105- /* List of sockets hashed to this bucket */
106- struct hlist_head owners ;
107- };
108-
10993static inline struct net * ib_net (struct inet_bind_bucket * ib )
11094{
11195 return read_pnet (& ib -> ib_net );
11296}
11397
114- static inline struct net * ib2_net (struct inet_bind2_bucket * ib )
115- {
116- return read_pnet (& ib -> ib_net );
117- }
118-
11998#define inet_bind_bucket_for_each (tb , head ) \
12099 hlist_for_each_entry(tb, head, node)
121100
@@ -124,15 +103,6 @@ struct inet_bind_hashbucket {
124103 struct hlist_head chain ;
125104};
126105
127- /* This is synchronized using the inet_bind_hashbucket's spinlock.
128- * Instead of having separate spinlocks, the inet_bind2_hashbucket can share
129- * the inet_bind_hashbucket's given that in every case where the bhash2 table
130- * is useful, a lookup in the bhash table also occurs.
131- */
132- struct inet_bind2_hashbucket {
133- struct hlist_head chain ;
134- };
135-
136106/* Sockets can be hashed in established or listening table.
137107 * We must use different 'nulls' end-of-chain value for all hash buckets :
138108 * A socket might transition from ESTABLISH to LISTEN state without
@@ -164,12 +134,6 @@ struct inet_hashinfo {
164134 */
165135 struct kmem_cache * bind_bucket_cachep ;
166136 struct inet_bind_hashbucket * bhash ;
167- /* The 2nd binding table hashed by port and address.
168- * This is used primarily for expediting the resolution of bind
169- * conflicts.
170- */
171- struct kmem_cache * bind2_bucket_cachep ;
172- struct inet_bind2_hashbucket * bhash2 ;
173137 unsigned int bhash_size ;
174138
175139 /* The 2nd listener table hashed by local port and address */
@@ -229,44 +193,14 @@ inet_bind_bucket_create(struct kmem_cache *cachep, struct net *net,
229193void inet_bind_bucket_destroy (struct kmem_cache * cachep ,
230194 struct inet_bind_bucket * tb );
231195
232- static inline bool check_bind_bucket_match (struct inet_bind_bucket * tb ,
233- struct net * net ,
234- const unsigned short port ,
235- int l3mdev )
236- {
237- return net_eq (ib_net (tb ), net ) && tb -> port == port &&
238- tb -> l3mdev == l3mdev ;
239- }
240-
241- struct inet_bind2_bucket *
242- inet_bind2_bucket_create (struct kmem_cache * cachep , struct net * net ,
243- struct inet_bind2_hashbucket * head ,
244- const unsigned short port , int l3mdev ,
245- const struct sock * sk );
246-
247- void inet_bind2_bucket_destroy (struct kmem_cache * cachep ,
248- struct inet_bind2_bucket * tb );
249-
250- struct inet_bind2_bucket *
251- inet_bind2_bucket_find (struct inet_hashinfo * hinfo , struct net * net ,
252- const unsigned short port , int l3mdev ,
253- struct sock * sk ,
254- struct inet_bind2_hashbucket * * head );
255-
256- bool check_bind2_bucket_match_nulladdr (struct inet_bind2_bucket * tb ,
257- struct net * net ,
258- const unsigned short port ,
259- int l3mdev ,
260- const struct sock * sk );
261-
262196static inline u32 inet_bhashfn (const struct net * net , const __u16 lport ,
263197 const u32 bhash_size )
264198{
265199 return (lport + net_hash_mix (net )) & (bhash_size - 1 );
266200}
267201
268202void inet_bind_hash (struct sock * sk , struct inet_bind_bucket * tb ,
269- struct inet_bind2_bucket * tb2 , const unsigned short snum );
203+ const unsigned short snum );
270204
271205/* Caller must disable local BH processing. */
272206int __inet_inherit_port (const struct sock * sk , struct sock * child );
0 commit comments