Remove unnecessary recursive epoch enter via INP_INFO_RLOCK

macro in raw input functions for IPv4 and IPv6.  They shall
always run in the network epoch.
This commit is contained in:
Gleb Smirnoff 2019-11-07 20:40:44 +00:00
parent 8d28524a90
commit f42347c39a
2 changed files with 4 additions and 6 deletions

View File

@ -284,9 +284,10 @@ rip_input(struct mbuf **mp, int *offp, int proto)
struct ip *ip = mtod(m, struct ip *);
struct inpcb *inp, *last;
struct sockaddr_in ripsrc;
struct epoch_tracker et;
int hash;
NET_EPOCH_ASSERT();
*mp = NULL;
bzero(&ripsrc, sizeof(ripsrc));
@ -299,7 +300,6 @@ rip_input(struct mbuf **mp, int *offp, int proto)
hash = INP_PCBHASH_RAW(proto, ip->ip_src.s_addr,
ip->ip_dst.s_addr, V_ripcbinfo.ipi_hashmask);
INP_INFO_RLOCK_ET(&V_ripcbinfo, et);
CK_LIST_FOREACH(inp, &V_ripcbinfo.ipi_hashbase[hash], inp_hash) {
if (inp->inp_ip_p != proto)
continue;
@ -422,7 +422,6 @@ rip_input(struct mbuf **mp, int *offp, int proto)
skip_2:
INP_RUNLOCK(inp);
}
INP_INFO_RUNLOCK_ET(&V_ripcbinfo, et);
if (last != NULL) {
if (rip_append(last, ip, m, &ripsrc) != 0)
IPSTAT_INC(ips_delivered);

View File

@ -165,7 +165,8 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
struct inpcb *last = NULL;
struct mbuf *opts = NULL;
struct sockaddr_in6 fromsa;
struct epoch_tracker et;
NET_EPOCH_ASSERT();
RIP6STAT_INC(rip6s_ipackets);
@ -173,7 +174,6 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
ifp = m->m_pkthdr.rcvif;
INP_INFO_RLOCK_ET(&V_ripcbinfo, et);
CK_LIST_FOREACH(inp, &V_ripcb, inp_list) {
/* XXX inp locking */
if ((inp->inp_vflag & INP_IPV6) == 0)
@ -303,7 +303,6 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
skip_2:
INP_RUNLOCK(inp);
}
INP_INFO_RUNLOCK_ET(&V_ripcbinfo, et);
#if defined(IPSEC) || defined(IPSEC_SUPPORT)
/*
* Check AH/ESP integrity.