* Remove PCB from various lists. */
| 2879 | * Remove PCB from various lists. |
| 2880 | */ |
| 2881 | static void |
| 2882 | in_pcbremlists(struct inpcb *inp) |
| 2883 | { |
| 2884 | struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; |
| 2885 | |
| 2886 | INP_WLOCK_ASSERT(inp); |
| 2887 | INP_LIST_WLOCK_ASSERT(pcbinfo); |
| 2888 | |
| 2889 | inp->inp_gencnt = ++pcbinfo->ipi_gencnt; |
| 2890 | if (inp->inp_flags & INP_INHASHLIST) { |
| 2891 | struct inpcbport *phd = inp->inp_phd; |
| 2892 | |
| 2893 | INP_HASH_WLOCK(pcbinfo); |
| 2894 | |
| 2895 | /* XXX: Only do if SO_REUSEPORT_LB set? */ |
| 2896 | in_pcbremlbgrouphash(inp); |
| 2897 | |
| 2898 | CK_LIST_REMOVE(inp, inp_hash); |
| 2899 | CK_LIST_REMOVE(inp, inp_portlist); |
| 2900 | if (CK_LIST_FIRST(&phd->phd_pcblist) == NULL) { |
| 2901 | CK_LIST_REMOVE(phd, phd_hash); |
| 2902 | NET_EPOCH_CALL(inpcbport_free, &phd->phd_epoch_ctx); |
| 2903 | } |
| 2904 | INP_HASH_WUNLOCK(pcbinfo); |
| 2905 | inp->inp_flags &= ~INP_INHASHLIST; |
| 2906 | } |
| 2907 | CK_LIST_REMOVE(inp, inp_list); |
| 2908 | pcbinfo->ipi_count--; |
| 2909 | #ifdef PCBGROUP |
| 2910 | in_pcbgroup_remove(inp); |
| 2911 | #endif |
| 2912 | } |
| 2913 | |
| 2914 | /* |
| 2915 | * Check for alternatives when higher level complains |
no test coverage detected