* Find the hash bucket for the given connection. */
| 559 | * Find the hash bucket for the given connection. |
| 560 | */ |
| 561 | static struct syncache_head * |
| 562 | syncache_hashbucket(struct in_conninfo *inc) |
| 563 | { |
| 564 | uint32_t hash; |
| 565 | |
| 566 | /* |
| 567 | * The hash is built on foreign port + local port + foreign address. |
| 568 | * We rely on the fact that struct in_conninfo starts with 16 bits |
| 569 | * of foreign port, then 16 bits of local port then followed by 128 |
| 570 | * bits of foreign address. In case of IPv4 address, the first 3 |
| 571 | * 32-bit words of the address always are zeroes. |
| 572 | */ |
| 573 | hash = jenkins_hash32((uint32_t *)&inc->inc_ie, 5, |
| 574 | V_tcp_syncache.hash_secret) & V_tcp_syncache.hashmask; |
| 575 | |
| 576 | return (&V_tcp_syncache.hashbase[hash]); |
| 577 | } |
| 578 | |
| 579 | /* |
| 580 | * Find an entry in the syncache. |
no test coverage detected