| 1686 | } |
| 1687 | |
| 1688 | static void |
| 1689 | udp_detach(struct socket *so) |
| 1690 | { |
| 1691 | struct inpcb *inp; |
| 1692 | struct inpcbinfo *pcbinfo; |
| 1693 | struct udpcb *up; |
| 1694 | |
| 1695 | pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); |
| 1696 | inp = sotoinpcb(so); |
| 1697 | KASSERT(inp != NULL, ("udp_detach: inp == NULL")); |
| 1698 | KASSERT(inp->inp_faddr.s_addr == INADDR_ANY, |
| 1699 | ("udp_detach: not disconnected")); |
| 1700 | INP_INFO_WLOCK(pcbinfo); |
| 1701 | INP_WLOCK(inp); |
| 1702 | up = intoudpcb(inp); |
| 1703 | KASSERT(up != NULL, ("%s: up == NULL", __func__)); |
| 1704 | inp->inp_ppcb = NULL; |
| 1705 | in_pcbdetach(inp); |
| 1706 | in_pcbfree(inp); |
| 1707 | INP_INFO_WUNLOCK(pcbinfo); |
| 1708 | udp_discardcb(up); |
| 1709 | } |
| 1710 | |
| 1711 | static int |
| 1712 | udp_disconnect(struct socket *so) |
nothing calls this directly
no test coverage detected