From 3cce6164ab9bb5a8ba569e2ae0e14099b6db46fd Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Thu, 2 Dec 2021 11:15:04 -0800 Subject: [PATCH] ip_input: remove pointless check in INP_RECVIF handling An mbuf rcvif pointer is supposed to be valid and doesn't need extra checks. The code appeared in d314ad7b73639. --- sys/netinet/ip_input.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 9db1f8c6f2e7..44500c46b0d8 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1281,8 +1281,7 @@ ip_savecontrol(struct inpcb *inp, struct mbuf **mp, struct ip *ip, struct sockaddr_dl *sdp; struct sockaddr_dl *sdl2 = &sdlbuf.sdl; - if ((ifp = m->m_pkthdr.rcvif) && - ifp->if_index && ifp->if_index <= V_if_index) { + if ((ifp = m->m_pkthdr.rcvif)) { sdp = (struct sockaddr_dl *)ifp->if_addr->ifa_addr; /* * Change our mind and don't try copy.