git: 01f11ee1c543 - main - sdp: garbage collect sdp_ctlinput
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 16 Aug 2022 19:38:42 UTC
The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=01f11ee1c543763b2864deb5e4592f441da2e8da commit 01f11ee1c543763b2864deb5e4592f441da2e8da Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2022-08-16 19:38:15 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2022-08-16 19:38:15 +0000 sdp: garbage collect sdp_ctlinput The pr_ctlinput method was a feature of IPv4/IPv6 with exception of pfctlinput(), which broadcasted a call to pr_ctlinput on all protocols ever registered statically or with pf_proto_register(). Now that this broadcast call is gone, the only protocols that get their pr_ctlinput ever called are those that have registered itselves with ipproto_register() or ip6proto_register(). It is entirely possible that code deleted now was dead code from very beginning. Just a copy-paste from TCP. Reviewed by: rstone Differential revision: https://reviews.freebsd.org/D36208 --- sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c | 34 -------------------------- 1 file changed, 34 deletions(-) diff --git a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c index 8382854e24e2..b5de5ed11b00 100644 --- a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c +++ b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c @@ -241,26 +241,6 @@ sdp_getpeeraddr(struct socket *so, struct sockaddr **nam) return 0; } -static void -sdp_pcbnotifyall(struct in_addr faddr, int errno, - struct sdp_sock *(*notify)(struct sdp_sock *, int)) -{ - struct sdp_sock *ssk, *ssk_temp; - - SDP_LIST_WLOCK(); - LIST_FOREACH_SAFE(ssk, &sdp_list, list, ssk_temp) { - SDP_WLOCK(ssk); - if (ssk->faddr != faddr.s_addr || ssk->socket == NULL) { - SDP_WUNLOCK(ssk); - continue; - } - if ((ssk->flags & SDP_DESTROY) == 0) - if ((*notify)(ssk, errno)) - SDP_WUNLOCK(ssk); - } - SDP_LIST_WUNLOCK(); -} - #if 0 static void sdp_apply_all(void (*func)(struct sdp_sock *, void *), void *arg) @@ -1563,18 +1543,6 @@ sdp_notify(struct sdp_sock *ssk, int error) return sdp_drop(ssk, error); } -static void -sdp_ctlinput(int cmd, struct sockaddr *sa, void *vip) -{ - struct in_addr faddr; - - faddr = ((struct sockaddr_in *)sa)->sin_addr; - if (sa->sa_family != AF_INET || faddr.s_addr == INADDR_ANY) - return; - - sdp_pcbnotifyall(faddr, inetctlerrmap[cmd], sdp_notify); -} - static void sdp_keepalive_timeout(void *data) { @@ -1935,7 +1903,6 @@ struct protosw sdpsw[] = { .pr_domain = &sdpdomain, .pr_protocol = IPPROTO_IP, .pr_flags = PR_CONNREQUIRED|PR_IMPLOPCL|PR_WANTRCVD, - .pr_ctlinput = sdp_ctlinput, .pr_ctloutput = sdp_ctloutput, .pr_usrreqs = &sdp_usrreqs }, @@ -1944,7 +1911,6 @@ struct protosw sdpsw[] = { .pr_domain = &sdpdomain, .pr_protocol = IPPROTO_TCP, .pr_flags = PR_CONNREQUIRED|PR_IMPLOPCL|PR_WANTRCVD, - .pr_ctlinput = sdp_ctlinput, .pr_ctloutput = sdp_ctloutput, .pr_usrreqs = &sdp_usrreqs },