inet_hashtables.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. /*
  2. * INET An implementation of the TCP/IP protocol suite for the LINUX
  3. * operating system. INET is implemented using the BSD Socket
  4. * interface as the means of communication with the user level.
  5. *
  6. * Generic INET transport hashtables
  7. *
  8. * Authors: Lotsa people, from code originally in tcp
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License
  12. * as published by the Free Software Foundation; either version
  13. * 2 of the License, or (at your option) any later version.
  14. */
  15. #include <linux/module.h>
  16. #include <linux/random.h>
  17. #include <linux/sched.h>
  18. #include <linux/slab.h>
  19. #include <linux/wait.h>
  20. #include <net/inet_connection_sock.h>
  21. #include <net/inet_hashtables.h>
  22. #include <net/secure_seq.h>
  23. #include <net/ip.h>
  24. static u32 inet_ehashfn(const struct net *net, const __be32 laddr,
  25. const __u16 lport, const __be32 faddr,
  26. const __be16 fport)
  27. {
  28. static u32 inet_ehash_secret __read_mostly;
  29. net_get_random_once(&inet_ehash_secret, sizeof(inet_ehash_secret));
  30. return __inet_ehashfn(laddr, lport, faddr, fport,
  31. inet_ehash_secret + net_hash_mix(net));
  32. }
  33. /* This function handles inet_sock, but also timewait and request sockets
  34. * for IPv4/IPv6.
  35. */
  36. u32 sk_ehashfn(const struct sock *sk)
  37. {
  38. #if IS_ENABLED(CONFIG_IPV6)
  39. if (sk->sk_family == AF_INET6 &&
  40. !ipv6_addr_v4mapped(&sk->sk_v6_daddr))
  41. return inet6_ehashfn(sock_net(sk),
  42. &sk->sk_v6_rcv_saddr, sk->sk_num,
  43. &sk->sk_v6_daddr, sk->sk_dport);
  44. #endif
  45. return inet_ehashfn(sock_net(sk),
  46. sk->sk_rcv_saddr, sk->sk_num,
  47. sk->sk_daddr, sk->sk_dport);
  48. }
  49. /*
  50. * Allocate and initialize a new local port bind bucket.
  51. * The bindhash mutex for snum's hash chain must be held here.
  52. */
  53. struct inet_bind_bucket *inet_bind_bucket_create(struct kmem_cache *cachep,
  54. struct net *net,
  55. struct inet_bind_hashbucket *head,
  56. const unsigned short snum)
  57. {
  58. struct inet_bind_bucket *tb = kmem_cache_alloc(cachep, GFP_ATOMIC);
  59. if (tb != NULL) {
  60. write_pnet(&tb->ib_net, net);
  61. tb->port = snum;
  62. tb->fastreuse = 0;
  63. tb->fastreuseport = 0;
  64. tb->num_owners = 0;
  65. INIT_HLIST_HEAD(&tb->owners);
  66. hlist_add_head(&tb->node, &head->chain);
  67. }
  68. return tb;
  69. }
  70. /*
  71. * Caller must hold hashbucket lock for this tb with local BH disabled
  72. */
  73. void inet_bind_bucket_destroy(struct kmem_cache *cachep, struct inet_bind_bucket *tb)
  74. {
  75. if (hlist_empty(&tb->owners)) {
  76. __hlist_del(&tb->node);
  77. kmem_cache_free(cachep, tb);
  78. }
  79. }
  80. void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb,
  81. const unsigned short snum)
  82. {
  83. struct inet_hashinfo *hashinfo = sk->sk_prot->h.hashinfo;
  84. atomic_inc(&hashinfo->bsockets);
  85. inet_sk(sk)->inet_num = snum;
  86. sk_add_bind_node(sk, &tb->owners);
  87. tb->num_owners++;
  88. inet_csk(sk)->icsk_bind_hash = tb;
  89. }
  90. /*
  91. * Get rid of any references to a local port held by the given sock.
  92. */
  93. static void __inet_put_port(struct sock *sk)
  94. {
  95. struct inet_hashinfo *hashinfo = sk->sk_prot->h.hashinfo;
  96. const int bhash = inet_bhashfn(sock_net(sk), inet_sk(sk)->inet_num,
  97. hashinfo->bhash_size);
  98. struct inet_bind_hashbucket *head = &hashinfo->bhash[bhash];
  99. struct inet_bind_bucket *tb;
  100. atomic_dec(&hashinfo->bsockets);
  101. spin_lock(&head->lock);
  102. tb = inet_csk(sk)->icsk_bind_hash;
  103. __sk_del_bind_node(sk);
  104. tb->num_owners--;
  105. inet_csk(sk)->icsk_bind_hash = NULL;
  106. inet_sk(sk)->inet_num = 0;
  107. inet_bind_bucket_destroy(hashinfo->bind_bucket_cachep, tb);
  108. spin_unlock(&head->lock);
  109. }
  110. void inet_put_port(struct sock *sk)
  111. {
  112. local_bh_disable();
  113. __inet_put_port(sk);
  114. local_bh_enable();
  115. }
  116. EXPORT_SYMBOL(inet_put_port);
  117. int __inet_inherit_port(struct sock *sk, struct sock *child)
  118. {
  119. struct inet_hashinfo *table = sk->sk_prot->h.hashinfo;
  120. unsigned short port = inet_sk(child)->inet_num;
  121. const int bhash = inet_bhashfn(sock_net(sk), port,
  122. table->bhash_size);
  123. struct inet_bind_hashbucket *head = &table->bhash[bhash];
  124. struct inet_bind_bucket *tb;
  125. spin_lock(&head->lock);
  126. tb = inet_csk(sk)->icsk_bind_hash;
  127. if (tb->port != port) {
  128. /* NOTE: using tproxy and redirecting skbs to a proxy
  129. * on a different listener port breaks the assumption
  130. * that the listener socket's icsk_bind_hash is the same
  131. * as that of the child socket. We have to look up or
  132. * create a new bind bucket for the child here. */
  133. inet_bind_bucket_for_each(tb, &head->chain) {
  134. if (net_eq(ib_net(tb), sock_net(sk)) &&
  135. tb->port == port)
  136. break;
  137. }
  138. if (!tb) {
  139. tb = inet_bind_bucket_create(table->bind_bucket_cachep,
  140. sock_net(sk), head, port);
  141. if (!tb) {
  142. spin_unlock(&head->lock);
  143. return -ENOMEM;
  144. }
  145. }
  146. }
  147. inet_bind_hash(child, tb, port);
  148. spin_unlock(&head->lock);
  149. return 0;
  150. }
  151. EXPORT_SYMBOL_GPL(__inet_inherit_port);
  152. static inline int compute_score(struct sock *sk, struct net *net,
  153. const unsigned short hnum, const __be32 daddr,
  154. const int dif)
  155. {
  156. int score = -1;
  157. struct inet_sock *inet = inet_sk(sk);
  158. if (net_eq(sock_net(sk), net) && inet->inet_num == hnum &&
  159. !ipv6_only_sock(sk)) {
  160. __be32 rcv_saddr = inet->inet_rcv_saddr;
  161. score = sk->sk_family == PF_INET ? 2 : 1;
  162. if (rcv_saddr) {
  163. if (rcv_saddr != daddr)
  164. return -1;
  165. score += 4;
  166. }
  167. if (sk->sk_bound_dev_if) {
  168. if (sk->sk_bound_dev_if != dif)
  169. return -1;
  170. score += 4;
  171. }
  172. }
  173. return score;
  174. }
  175. /*
  176. * Don't inline this cruft. Here are some nice properties to exploit here. The
  177. * BSD API does not allow a listening sock to specify the remote port nor the
  178. * remote address for the connection. So always assume those are both
  179. * wildcarded during the search since they can never be otherwise.
  180. */
  181. struct sock *__inet_lookup_listener(struct net *net,
  182. struct inet_hashinfo *hashinfo,
  183. const __be32 saddr, __be16 sport,
  184. const __be32 daddr, const unsigned short hnum,
  185. const int dif)
  186. {
  187. struct sock *sk, *result;
  188. struct hlist_nulls_node *node;
  189. unsigned int hash = inet_lhashfn(net, hnum);
  190. struct inet_listen_hashbucket *ilb = &hashinfo->listening_hash[hash];
  191. int score, hiscore, matches = 0, reuseport = 0;
  192. u32 phash = 0;
  193. rcu_read_lock();
  194. begin:
  195. result = NULL;
  196. hiscore = 0;
  197. sk_nulls_for_each_rcu(sk, node, &ilb->head) {
  198. score = compute_score(sk, net, hnum, daddr, dif);
  199. if (score > hiscore) {
  200. result = sk;
  201. hiscore = score;
  202. reuseport = sk->sk_reuseport;
  203. if (reuseport) {
  204. phash = inet_ehashfn(net, daddr, hnum,
  205. saddr, sport);
  206. matches = 1;
  207. }
  208. } else if (score == hiscore && reuseport) {
  209. matches++;
  210. if (reciprocal_scale(phash, matches) == 0)
  211. result = sk;
  212. phash = next_pseudo_random32(phash);
  213. }
  214. }
  215. /*
  216. * if the nulls value we got at the end of this lookup is
  217. * not the expected one, we must restart lookup.
  218. * We probably met an item that was moved to another chain.
  219. */
  220. if (get_nulls_value(node) != hash + LISTENING_NULLS_BASE)
  221. goto begin;
  222. if (result) {
  223. if (unlikely(!atomic_inc_not_zero(&result->sk_refcnt)))
  224. result = NULL;
  225. else if (unlikely(compute_score(result, net, hnum, daddr,
  226. dif) < hiscore)) {
  227. sock_put(result);
  228. goto begin;
  229. }
  230. }
  231. rcu_read_unlock();
  232. return result;
  233. }
  234. EXPORT_SYMBOL_GPL(__inet_lookup_listener);
  235. /* All sockets share common refcount, but have different destructors */
  236. void sock_gen_put(struct sock *sk)
  237. {
  238. if (!atomic_dec_and_test(&sk->sk_refcnt))
  239. return;
  240. if (sk->sk_state == TCP_TIME_WAIT)
  241. inet_twsk_free(inet_twsk(sk));
  242. else if (sk->sk_state == TCP_NEW_SYN_RECV)
  243. reqsk_free(inet_reqsk(sk));
  244. else
  245. sk_free(sk);
  246. }
  247. EXPORT_SYMBOL_GPL(sock_gen_put);
  248. void sock_edemux(struct sk_buff *skb)
  249. {
  250. sock_gen_put(skb->sk);
  251. }
  252. EXPORT_SYMBOL(sock_edemux);
  253. struct sock *__inet_lookup_established(struct net *net,
  254. struct inet_hashinfo *hashinfo,
  255. const __be32 saddr, const __be16 sport,
  256. const __be32 daddr, const u16 hnum,
  257. const int dif)
  258. {
  259. INET_ADDR_COOKIE(acookie, saddr, daddr);
  260. const __portpair ports = INET_COMBINED_PORTS(sport, hnum);
  261. struct sock *sk;
  262. const struct hlist_nulls_node *node;
  263. /* Optimize here for direct hit, only listening connections can
  264. * have wildcards anyways.
  265. */
  266. unsigned int hash = inet_ehashfn(net, daddr, hnum, saddr, sport);
  267. unsigned int slot = hash & hashinfo->ehash_mask;
  268. struct inet_ehash_bucket *head = &hashinfo->ehash[slot];
  269. rcu_read_lock();
  270. begin:
  271. sk_nulls_for_each_rcu(sk, node, &head->chain) {
  272. if (sk->sk_hash != hash)
  273. continue;
  274. if (likely(INET_MATCH(sk, net, acookie,
  275. saddr, daddr, ports, dif))) {
  276. if (unlikely(!atomic_inc_not_zero(&sk->sk_refcnt)))
  277. goto out;
  278. if (unlikely(!INET_MATCH(sk, net, acookie,
  279. saddr, daddr, ports, dif))) {
  280. sock_gen_put(sk);
  281. goto begin;
  282. }
  283. goto found;
  284. }
  285. }
  286. /*
  287. * if the nulls value we got at the end of this lookup is
  288. * not the expected one, we must restart lookup.
  289. * We probably met an item that was moved to another chain.
  290. */
  291. if (get_nulls_value(node) != slot)
  292. goto begin;
  293. out:
  294. sk = NULL;
  295. found:
  296. rcu_read_unlock();
  297. return sk;
  298. }
  299. EXPORT_SYMBOL_GPL(__inet_lookup_established);
  300. /* called with local bh disabled */
  301. static int __inet_check_established(struct inet_timewait_death_row *death_row,
  302. struct sock *sk, __u16 lport,
  303. struct inet_timewait_sock **twp)
  304. {
  305. struct inet_hashinfo *hinfo = death_row->hashinfo;
  306. struct inet_sock *inet = inet_sk(sk);
  307. __be32 daddr = inet->inet_rcv_saddr;
  308. __be32 saddr = inet->inet_daddr;
  309. int dif = sk->sk_bound_dev_if;
  310. INET_ADDR_COOKIE(acookie, saddr, daddr);
  311. const __portpair ports = INET_COMBINED_PORTS(inet->inet_dport, lport);
  312. struct net *net = sock_net(sk);
  313. unsigned int hash = inet_ehashfn(net, daddr, lport,
  314. saddr, inet->inet_dport);
  315. struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash);
  316. spinlock_t *lock = inet_ehash_lockp(hinfo, hash);
  317. struct sock *sk2;
  318. const struct hlist_nulls_node *node;
  319. struct inet_timewait_sock *tw = NULL;
  320. int twrefcnt = 0;
  321. spin_lock(lock);
  322. sk_nulls_for_each(sk2, node, &head->chain) {
  323. if (sk2->sk_hash != hash)
  324. continue;
  325. if (likely(INET_MATCH(sk2, net, acookie,
  326. saddr, daddr, ports, dif))) {
  327. if (sk2->sk_state == TCP_TIME_WAIT) {
  328. tw = inet_twsk(sk2);
  329. if (twsk_unique(sk, sk2, twp))
  330. break;
  331. }
  332. goto not_unique;
  333. }
  334. }
  335. /* Must record num and sport now. Otherwise we will see
  336. * in hash table socket with a funny identity.
  337. */
  338. inet->inet_num = lport;
  339. inet->inet_sport = htons(lport);
  340. sk->sk_hash = hash;
  341. WARN_ON(!sk_unhashed(sk));
  342. __sk_nulls_add_node_rcu(sk, &head->chain);
  343. if (tw) {
  344. twrefcnt = inet_twsk_unhash(tw);
  345. NET_INC_STATS_BH(net, LINUX_MIB_TIMEWAITRECYCLED);
  346. }
  347. spin_unlock(lock);
  348. if (twrefcnt)
  349. inet_twsk_put(tw);
  350. sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
  351. if (twp) {
  352. *twp = tw;
  353. } else if (tw) {
  354. /* Silly. Should hash-dance instead... */
  355. inet_twsk_deschedule(tw, death_row);
  356. inet_twsk_put(tw);
  357. }
  358. return 0;
  359. not_unique:
  360. spin_unlock(lock);
  361. return -EADDRNOTAVAIL;
  362. }
  363. static inline u32 inet_sk_port_offset(const struct sock *sk)
  364. {
  365. const struct inet_sock *inet = inet_sk(sk);
  366. return secure_ipv4_port_ephemeral(inet->inet_rcv_saddr,
  367. inet->inet_daddr,
  368. inet->inet_dport);
  369. }
  370. int __inet_hash_nolisten(struct sock *sk, struct inet_timewait_sock *tw)
  371. {
  372. struct inet_hashinfo *hashinfo = sk->sk_prot->h.hashinfo;
  373. struct hlist_nulls_head *list;
  374. struct inet_ehash_bucket *head;
  375. spinlock_t *lock;
  376. int twrefcnt = 0;
  377. WARN_ON(!sk_unhashed(sk));
  378. sk->sk_hash = sk_ehashfn(sk);
  379. head = inet_ehash_bucket(hashinfo, sk->sk_hash);
  380. list = &head->chain;
  381. lock = inet_ehash_lockp(hashinfo, sk->sk_hash);
  382. spin_lock(lock);
  383. __sk_nulls_add_node_rcu(sk, list);
  384. if (tw) {
  385. WARN_ON(sk->sk_hash != tw->tw_hash);
  386. twrefcnt = inet_twsk_unhash(tw);
  387. }
  388. spin_unlock(lock);
  389. sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
  390. return twrefcnt;
  391. }
  392. EXPORT_SYMBOL_GPL(__inet_hash_nolisten);
  393. int __inet_hash(struct sock *sk, struct inet_timewait_sock *tw)
  394. {
  395. struct inet_hashinfo *hashinfo = sk->sk_prot->h.hashinfo;
  396. struct inet_listen_hashbucket *ilb;
  397. if (sk->sk_state != TCP_LISTEN)
  398. return __inet_hash_nolisten(sk, tw);
  399. WARN_ON(!sk_unhashed(sk));
  400. ilb = &hashinfo->listening_hash[inet_sk_listen_hashfn(sk)];
  401. spin_lock(&ilb->lock);
  402. __sk_nulls_add_node_rcu(sk, &ilb->head);
  403. sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
  404. spin_unlock(&ilb->lock);
  405. return 0;
  406. }
  407. EXPORT_SYMBOL(__inet_hash);
  408. void inet_hash(struct sock *sk)
  409. {
  410. if (sk->sk_state != TCP_CLOSE) {
  411. local_bh_disable();
  412. __inet_hash(sk, NULL);
  413. local_bh_enable();
  414. }
  415. }
  416. EXPORT_SYMBOL_GPL(inet_hash);
  417. void inet_unhash(struct sock *sk)
  418. {
  419. struct inet_hashinfo *hashinfo = sk->sk_prot->h.hashinfo;
  420. spinlock_t *lock;
  421. int done;
  422. if (sk_unhashed(sk))
  423. return;
  424. if (sk->sk_state == TCP_LISTEN)
  425. lock = &hashinfo->listening_hash[inet_sk_listen_hashfn(sk)].lock;
  426. else
  427. lock = inet_ehash_lockp(hashinfo, sk->sk_hash);
  428. spin_lock_bh(lock);
  429. done = __sk_nulls_del_node_init_rcu(sk);
  430. if (done)
  431. sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
  432. spin_unlock_bh(lock);
  433. }
  434. EXPORT_SYMBOL_GPL(inet_unhash);
  435. int __inet_hash_connect(struct inet_timewait_death_row *death_row,
  436. struct sock *sk, u32 port_offset,
  437. int (*check_established)(struct inet_timewait_death_row *,
  438. struct sock *, __u16, struct inet_timewait_sock **))
  439. {
  440. struct inet_hashinfo *hinfo = death_row->hashinfo;
  441. const unsigned short snum = inet_sk(sk)->inet_num;
  442. struct inet_bind_hashbucket *head;
  443. struct inet_bind_bucket *tb;
  444. int ret;
  445. struct net *net = sock_net(sk);
  446. int twrefcnt = 1;
  447. if (!snum) {
  448. int i, remaining, low, high, port;
  449. static u32 hint;
  450. u32 offset = hint + port_offset;
  451. struct inet_timewait_sock *tw = NULL;
  452. inet_get_local_port_range(net, &low, &high);
  453. remaining = (high - low) + 1;
  454. local_bh_disable();
  455. for (i = 1; i <= remaining; i++) {
  456. port = low + (i + offset) % remaining;
  457. if (inet_is_local_reserved_port(net, port))
  458. continue;
  459. head = &hinfo->bhash[inet_bhashfn(net, port,
  460. hinfo->bhash_size)];
  461. spin_lock(&head->lock);
  462. /* Does not bother with rcv_saddr checks,
  463. * because the established check is already
  464. * unique enough.
  465. */
  466. inet_bind_bucket_for_each(tb, &head->chain) {
  467. if (net_eq(ib_net(tb), net) &&
  468. tb->port == port) {
  469. if (tb->fastreuse >= 0 ||
  470. tb->fastreuseport >= 0)
  471. goto next_port;
  472. WARN_ON(hlist_empty(&tb->owners));
  473. if (!check_established(death_row, sk,
  474. port, &tw))
  475. goto ok;
  476. goto next_port;
  477. }
  478. }
  479. tb = inet_bind_bucket_create(hinfo->bind_bucket_cachep,
  480. net, head, port);
  481. if (!tb) {
  482. spin_unlock(&head->lock);
  483. break;
  484. }
  485. tb->fastreuse = -1;
  486. tb->fastreuseport = -1;
  487. goto ok;
  488. next_port:
  489. spin_unlock(&head->lock);
  490. }
  491. local_bh_enable();
  492. return -EADDRNOTAVAIL;
  493. ok:
  494. hint += i;
  495. /* Head lock still held and bh's disabled */
  496. inet_bind_hash(sk, tb, port);
  497. if (sk_unhashed(sk)) {
  498. inet_sk(sk)->inet_sport = htons(port);
  499. twrefcnt += __inet_hash_nolisten(sk, tw);
  500. }
  501. if (tw)
  502. twrefcnt += inet_twsk_bind_unhash(tw, hinfo);
  503. spin_unlock(&head->lock);
  504. if (tw) {
  505. inet_twsk_deschedule(tw, death_row);
  506. while (twrefcnt) {
  507. twrefcnt--;
  508. inet_twsk_put(tw);
  509. }
  510. }
  511. ret = 0;
  512. goto out;
  513. }
  514. head = &hinfo->bhash[inet_bhashfn(net, snum, hinfo->bhash_size)];
  515. tb = inet_csk(sk)->icsk_bind_hash;
  516. spin_lock_bh(&head->lock);
  517. if (sk_head(&tb->owners) == sk && !sk->sk_bind_node.next) {
  518. __inet_hash_nolisten(sk, NULL);
  519. spin_unlock_bh(&head->lock);
  520. return 0;
  521. } else {
  522. spin_unlock(&head->lock);
  523. /* No definite answer... Walk to established hash table */
  524. ret = check_established(death_row, sk, snum, NULL);
  525. out:
  526. local_bh_enable();
  527. return ret;
  528. }
  529. }
  530. /*
  531. * Bind a port for a connect operation and hash it.
  532. */
  533. int inet_hash_connect(struct inet_timewait_death_row *death_row,
  534. struct sock *sk)
  535. {
  536. return __inet_hash_connect(death_row, sk, inet_sk_port_offset(sk),
  537. __inet_check_established);
  538. }
  539. EXPORT_SYMBOL_GPL(inet_hash_connect);
  540. void inet_hashinfo_init(struct inet_hashinfo *h)
  541. {
  542. int i;
  543. atomic_set(&h->bsockets, 0);
  544. for (i = 0; i < INET_LHTABLE_SIZE; i++) {
  545. spin_lock_init(&h->listening_hash[i].lock);
  546. INIT_HLIST_NULLS_HEAD(&h->listening_hash[i].head,
  547. i + LISTENING_NULLS_BASE);
  548. }
  549. }
  550. EXPORT_SYMBOL_GPL(inet_hashinfo_init);