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

Function in_pcbfree_deferred

freebsd/netinet/in_pcb.c:1810–1853  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1808}
1809
1810static void
1811in_pcbfree_deferred(epoch_context_t ctx)
1812{
1813 struct inpcb *inp;
1814 int released __unused;
1815
1816 inp = __containerof(ctx, struct inpcb, inp_epoch_ctx);
1817
1818 INP_WLOCK(inp);
1819 CURVNET_SET(inp->inp_vnet);
1820#ifdef INET
1821 struct ip_moptions *imo = inp->inp_moptions;
1822 inp->inp_moptions = NULL;
1823#endif
1824 /* XXXRW: Do as much as possible here. */
1825#if defined(IPSEC) || defined(IPSEC_SUPPORT)
1826 if (inp->inp_sp != NULL)
1827 ipsec_delete_pcbpolicy(inp);
1828#endif
1829#ifdef INET6
1830 struct ip6_moptions *im6o = NULL;
1831 if (inp->inp_vflag & INP_IPV6PROTO) {
1832 ip6_freepcbopts(inp->in6p_outputopts);
1833 im6o = inp->in6p_moptions;
1834 inp->in6p_moptions = NULL;
1835 }
1836#endif
1837 if (inp->inp_options)
1838 (void)m_free(inp->inp_options);
1839 inp->inp_vflag = 0;
1840 crfree(inp->inp_cred);
1841#ifdef MAC
1842 mac_inpcb_destroy(inp);
1843#endif
1844 released = in_pcbrele_wlocked(inp);
1845 MPASS(released);
1846#ifdef INET6
1847 ip6_freemoptions(im6o);
1848#endif
1849#ifdef INET
1850 inp_freemoptions(imo);
1851#endif
1852 CURVNET_RESTORE();
1853}
1854
1855/*
1856 * Unconditionally schedule an inpcb to be freed by decrementing its

Callers

nothing calls this directly

Calls 8

ipsec_delete_pcbpolicyFunction · 0.85
ip6_freepcboptsFunction · 0.85
mac_inpcb_destroyFunction · 0.85
in_pcbrele_wlockedFunction · 0.85
ip6_freemoptionsFunction · 0.85
inp_freemoptionsFunction · 0.85
m_freeFunction · 0.50
crfreeFunction · 0.50

Tested by

no test coverage detected