aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/ip_input.c
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2021-11-12 16:58:27 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2021-11-12 16:58:27 +0000
commit81674f121eeb741625a21ea5acf29d7580153817 (patch)
treee13105974166b22385692c6b3f3f4b189223985e /sys/netinet/ip_input.c
parent94df3271d6b2e3511f1ff234bcc16e8b031ce6df (diff)
downloadsrc-81674f121eeb741625a21ea5acf29d7580153817.tar.gz
src-81674f121eeb741625a21ea5acf29d7580153817.zip
ip_input: packet filters shall not modify m_pkthdr.rcvif
Quick review confirms that they do not, also IPv6 doesn't expect such a change in mbuf. In IPv4 this appeared in 0aade26e6d061, which doesn't seem to have a valid explanation why. Reviewed by: donner, kp, melifaro Differential revision: https://reviews.freebsd.org/D32913
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r--sys/netinet/ip_input.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 91fc7a3a63f7..a678c15caad5 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -607,7 +607,6 @@ tooshort:
ip = mtod(m, struct ip *);
dchg = (odst.s_addr != ip->ip_dst.s_addr);
- ifp = m->m_pkthdr.rcvif;
if (m->m_flags & M_FASTFWD_OURS) {
m->m_flags &= ~M_FASTFWD_OURS;
@@ -665,7 +664,7 @@ passin:
* checked it with carp_iamatch() and carp_forus().
*/
strong_es = V_ip_strong_es && (V_ipforwarding == 0) &&
- ifp != NULL && ((ifp->if_flags & IFF_LOOPBACK) == 0) &&
+ ((ifp->if_flags & IFF_LOOPBACK) == 0) &&
ifp->if_carp == NULL && (dchg == 0);
/*
@@ -697,7 +696,7 @@ passin:
* be handled via ip_forward() and ether_output() with the loopback
* into the stack for SIMPLEX interfaces handled by ether_output().
*/
- if (ifp != NULL && ifp->if_flags & IFF_BROADCAST) {
+ if (ifp->if_flags & IFF_BROADCAST) {
CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET)
continue;