git: bbbd7aab1bed - main - inpcb: garbage collect in_pcbnotifyall()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 20 Nov 2023 22:38:44 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=bbbd7aab1bed9122e7137ee0957d50c9ef22b315
commit bbbd7aab1bed9122e7137ee0957d50c9ef22b315
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2023-11-20 22:38:31 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2023-11-20 22:38:31 +0000
inpcb: garbage collect in_pcbnotifyall()
---
sys/netinet/in_pcb.c | 28 +---------------------------
sys/netinet/in_pcb.h | 2 --
2 files changed, 1 insertion(+), 29 deletions(-)
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 2586c107ceaf..dbae52103c61 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -1805,7 +1805,7 @@ inpcb_fini(void *mem, int size)
* in_pcbdetach().
*
* XXXRW: Possibly in_pcbdrop() should also prevent future notifications by
- * in_pcbnotifyall() and in_pcbpurgeif0()?
+ * in_pcbpurgeif0()?
*/
void
in_pcbdrop(struct inpcb *inp)
@@ -1879,32 +1879,6 @@ in_getpeeraddr(struct socket *so, struct sockaddr **nam)
return 0;
}
-void
-in_pcbnotifyall(struct inpcbinfo *pcbinfo, struct in_addr faddr, int errno,
- struct inpcb *(*notify)(struct inpcb *, int))
-{
- struct inpcb *inp, *inp_temp;
-
- INP_INFO_WLOCK(pcbinfo);
- CK_LIST_FOREACH_SAFE(inp, &pcbinfo->ipi_listhead, inp_list, inp_temp) {
- INP_WLOCK(inp);
-#ifdef INET6
- if ((inp->inp_vflag & INP_IPV4) == 0) {
- INP_WUNLOCK(inp);
- continue;
- }
-#endif
- if (inp->inp_faddr.s_addr != faddr.s_addr ||
- inp->inp_socket == NULL) {
- INP_WUNLOCK(inp);
- continue;
- }
- if ((*notify)(inp, errno))
- INP_WUNLOCK(inp);
- }
- INP_INFO_WUNLOCK(pcbinfo);
-}
-
static bool
inp_v4_multi_match(const struct inpcb *inp, void *v __unused)
{
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h
index 19d281937b52..aa9bcade4b32 100644
--- a/sys/netinet/in_pcb.h
+++ b/sys/netinet/in_pcb.h
@@ -686,8 +686,6 @@ struct inpcb *
struct inpcb *
in_pcblookup_mbuf(struct inpcbinfo *, struct in_addr, u_int,
struct in_addr, u_int, int, struct ifnet *, struct mbuf *);
-void in_pcbnotifyall(struct inpcbinfo *pcbinfo, struct in_addr,
- int, struct inpcb *(*)(struct inpcb *, int));
void in_pcbref(struct inpcb *);
void in_pcbrehash(struct inpcb *);
void in_pcbremhash_locked(struct inpcb *);