aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/igmp.c
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2020-02-17 09:46:32 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2020-02-17 09:46:32 +0000
commitbacb11c9ed37886069dbfe4303f414b731d5957e (patch)
tree8f757d6f4355a8867e7518a270ec7e2cdaa01f9b /sys/netinet/igmp.c
parented581bf68f8b81bc1ac6815257bc529c09bfe775 (diff)
downloadsrc-bacb11c9ed37886069dbfe4303f414b731d5957e.tar.gz
src-bacb11c9ed37886069dbfe4303f414b731d5957e.zip
Fix kernel panic while trying to read multicast stream.
When VIMAGE is enabled make sure the "m_pkthdr.rcvif" pointer is set for all mbufs being input by the IGMP/MLD6 code. Else there will be a NULL-pointer dereference in the netisr code when trying to set the VNET based on the incoming mbuf. Add an assert to catch this when queueing mbufs on a netisr to make debugging of similar cases easier. Found by: Vladislav V. Prodan PR: 244002 Reviewed by: bz@ MFC after: 1 week Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/head/; revision=358013
Diffstat (limited to 'sys/netinet/igmp.c')
-rw-r--r--sys/netinet/igmp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
index 5ee99dbb91d3..2a08e73317a2 100644
--- a/sys/netinet/igmp.c
+++ b/sys/netinet/igmp.c
@@ -303,6 +303,7 @@ igmp_save_context(struct mbuf *m, struct ifnet *ifp)
#ifdef VIMAGE
m->m_pkthdr.PH_loc.ptr = ifp->if_vnet;
#endif /* VIMAGE */
+ m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.flowid = ifp->if_index;
}