From: Sepherosa Ziehau Date: Mon, 19 May 2014 11:45:31 +0000 (+0800) Subject: inet: Return NULL from IN_LOOKUP_MULTI if ifnet is NULL X-Git-Tag: v3.9.0~22 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/d10df9e0ecf4c1ea02974c0c265caf277b671f83 inet: Return NULL from IN_LOOKUP_MULTI if ifnet is NULL This could happen for mbufs on ip_input path, whose rcvif could be NULL. --- diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h index cb5d0679de..3d523a4b54 100644 --- a/sys/netinet/in_var.h +++ b/sys/netinet/in_var.h @@ -203,6 +203,9 @@ IN_LOOKUP_MULTI(const struct in_addr *_addr, struct ifnet *_ifp) const struct ifmultiaddr *_ifma; struct in_multi *_inm = NULL; + if (_ifp == NULL) + return NULL; + /* TODO: need ifnet_serialize_main */ ifnet_serialize_all(_ifp); TAILQ_FOREACH(_ifma, &_ifp->if_multiaddrs, ifma_link) {