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

Function udp_abort

freebsd/netinet/udp_usrreq.c:1530–1548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1528}
1529
1530static void
1531udp_abort(struct socket *so)
1532{
1533 struct inpcb *inp;
1534 struct inpcbinfo *pcbinfo;
1535
1536 pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
1537 inp = sotoinpcb(so);
1538 KASSERT(inp != NULL, ("udp_abort: inp == NULL"));
1539 INP_WLOCK(inp);
1540 if (inp->inp_faddr.s_addr != INADDR_ANY) {
1541 INP_HASH_WLOCK(pcbinfo);
1542 in_pcbdisconnect(inp);
1543 inp->inp_laddr.s_addr = INADDR_ANY;
1544 INP_HASH_WUNLOCK(pcbinfo);
1545 soisdisconnected(so);
1546 }
1547 INP_WUNLOCK(inp);
1548}
1549
1550static int
1551udp_attach(struct socket *so, int proto, 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