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
This commit is contained in:
parent
886fc1e804
commit
948f31d7b0
@ -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)
|
||||
{
|
||||
|
@ -729,7 +729,6 @@ icmp_input(struct mbuf **mp, int *offp, int proto)
|
||||
(struct sockaddr *)&icmpgw, m->m_pkthdr.rcvif,
|
||||
RTF_GATEWAY, V_redirtimeout);
|
||||
}
|
||||
pfctlinput(PRC_REDIRECT_HOST, (struct sockaddr *)&icmpsrc);
|
||||
break;
|
||||
|
||||
/*
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user