MCPcopy Create free account
hub / github.com/F-Stack/f-stack / in_pcbremlists

Function in_pcbremlists

freebsd/netinet/in_pcb.c:2881–2912  ·  view source on GitHub ↗

* Remove PCB from various lists. */

Source from the content-addressed store, hash-verified

2879 * Remove PCB from various lists.
2880 */
2881static void
2882in_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

Callers 1

in_pcbfreeFunction · 0.85

Calls 2

in_pcbremlbgrouphashFunction · 0.85
in_pcbgroup_removeFunction · 0.85

Tested by

no test coverage detected