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

Function udp_close

freebsd/netinet/udp_usrreq.c:1634–1652  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1632}
1633
1634static void
1635udp_close(struct socket *so)
1636{
1637 struct inpcb *inp;
1638 struct inpcbinfo *pcbinfo;
1639
1640 pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
1641 inp = sotoinpcb(so);
1642 KASSERT(inp != NULL, ("udp_close: inp == NULL"));
1643 INP_WLOCK(inp);
1644 if (inp->inp_faddr.s_addr != INADDR_ANY) {
1645 INP_HASH_WLOCK(pcbinfo);
1646 in_pcbdisconnect(inp);
1647 inp->inp_laddr.s_addr = INADDR_ANY;
1648 INP_HASH_WUNLOCK(pcbinfo);
1649 soisdisconnected(so);
1650 }
1651 INP_WUNLOCK(inp);
1652}
1653
1654static int
1655udp_connect(struct socket *so, struct sockaddr *nam, struct thread *td)

Callers

nothing calls this directly

Calls 3

in_pcbdisconnectFunction · 0.85
soisdisconnectedFunction · 0.85
udp_get_inpcbinfoFunction · 0.70

Tested by

no test coverage detected