git: 948f31d7b0ed - main - netinet: do not broadcast PRC_REDIRECT_HOST on ICMP redirect
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 12 Aug 2022 15:32:47 UTC
The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=948f31d7b0ed31a834b31ac63f314aecef474dfe commit 948f31d7b0ed31a834b31ac63f314aecef474dfe Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2022-08-12 15:31:28 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2022-08-12 15:31:29 +0000 netinet: do not broadcast PRC_REDIRECT_HOST on ICMP redirect This is expensive and useless call. It has been useless since Alexander melifaro@ moved the forwarding table to nexthops with passive invalidation. What happens now is that cached route in a inpcb would get invalidated on next ip_output(). These were the last users of pfctlinput(), so garbage collect it. Reviewed by: melifaro Differential revision: https://reviews.freebsd.org/D36156 --- sys/kern/uipc_domain.c | 14 -------------- sys/netinet/ip_icmp.c | 1 - sys/netinet6/icmp6.c | 10 ---------- sys/sys/protosw.h | 1 - 4 files changed, 26 deletions(-) diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index 07e5f829e957..c70b3150cbf0 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -464,20 +464,6 @@ pf_proto_unregister(int family, int protocol, int type) return (0); } -void -pfctlinput(int cmd, struct sockaddr *sa) -{ - struct domain *dp; - struct protosw *pr; - - NET_EPOCH_ASSERT(); - - for (dp = domains; dp; dp = dp->dom_next) - for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) - if (pr->pr_ctlinput) - (*pr->pr_ctlinput)(cmd, sa, (void *)0); -} - static void pfslowtimo(void *arg) { diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index a710cc2ba8cd..2e548a539bf7 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -729,7 +729,6 @@ reflect: (struct sockaddr *)&icmpgw, m->m_pkthdr.rcvif, RTF_GATEWAY, V_redirtimeout); } - pfctlinput(PRC_REDIRECT_HOST, (struct sockaddr *)&icmpsrc); break; /* diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 832061ad9328..132b62260ab7 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -2350,16 +2350,6 @@ icmp6_redirect_input(struct mbuf *m, int off) (struct sockaddr *)&ssrc, ifp, rt_flags, V_icmp6_redirtimeout); } - /* finally update cached route in each socket via pfctlinput */ - { - struct sockaddr_in6 sdst; - - bzero(&sdst, sizeof(sdst)); - sdst.sin6_family = AF_INET6; - sdst.sin6_len = sizeof(struct sockaddr_in6); - bcopy(&reddst6, &sdst.sin6_addr, sizeof(struct in6_addr)); - pfctlinput(PRC_REDIRECT_HOST, (struct sockaddr *)&sdst); - } freeit: m_freem(m); diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h index 7c7eece83e78..78c25e6e77f6 100644 --- a/sys/sys/protosw.h +++ b/sys/sys/protosw.h @@ -364,7 +364,6 @@ char *prcorequests[] = { #endif #ifdef _KERNEL -void pfctlinput(int, struct sockaddr *); struct domain *pffinddomain(int family); struct protosw *pffindproto(int family, int protocol, int type); struct protosw *pffindtype(int family, int type);