git: 3cce6164ab9b - main - ip_input: remove pointless check in INP_RECVIF handling
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 02 Dec 2021 19:16:13 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=3cce6164ab9bb5a8ba569e2ae0e14099b6db46fd
commit 3cce6164ab9bb5a8ba569e2ae0e14099b6db46fd
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2021-12-02 19:15:04 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2021-12-02 19:15:04 +0000
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.