| 1709 | } |
| 1710 | |
| 1711 | static int |
| 1712 | udp_disconnect(struct socket *so) |
| 1713 | { |
| 1714 | struct inpcb *inp; |
| 1715 | struct inpcbinfo *pcbinfo; |
| 1716 | |
| 1717 | pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); |
| 1718 | inp = sotoinpcb(so); |
| 1719 | KASSERT(inp != NULL, ("udp_disconnect: inp == NULL")); |
| 1720 | INP_WLOCK(inp); |
| 1721 | if (inp->inp_faddr.s_addr == INADDR_ANY) { |
| 1722 | INP_WUNLOCK(inp); |
| 1723 | return (ENOTCONN); |
| 1724 | } |
| 1725 | INP_HASH_WLOCK(pcbinfo); |
| 1726 | in_pcbdisconnect(inp); |
| 1727 | inp->inp_laddr.s_addr = INADDR_ANY; |
| 1728 | INP_HASH_WUNLOCK(pcbinfo); |
| 1729 | SOCK_LOCK(so); |
| 1730 | so->so_state &= ~SS_ISCONNECTED; /* XXX */ |
| 1731 | SOCK_UNLOCK(so); |
| 1732 | INP_WUNLOCK(inp); |
| 1733 | return (0); |
| 1734 | } |
| 1735 | |
| 1736 | static int |
| 1737 | udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, |
nothing calls this directly
no test coverage detected