From f31b83e118dc0dff5133aed5a1c7fc831375d371 Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Fri, 25 Jan 2013 23:11:13 +0000 Subject: [PATCH] Avoid NULL dereference in nd6_storelladdr when no mbuf is provided. It is called this way from a couple of places in the OFED code. (toecore calls it too but that's going to change shortly). Reviewed by: bz@ --- sys/netinet6/nd6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 5107f1d9b10..0c1cd8b1668 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -2166,7 +2166,7 @@ nd6_storelladdr(struct ifnet *ifp, struct mbuf *m, *lle = NULL; IF_AFDATA_UNLOCK_ASSERT(ifp); - if (m->m_flags & M_MCAST) { + if (m != NULL && m->m_flags & M_MCAST) { int i; switch (ifp->if_type) {