| 1808 | } |
| 1809 | |
| 1810 | static void |
| 1811 | in_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 |
nothing calls this directly
no test coverage detected