aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/hyperv
diff options
context:
space:
mode:
authorDexuan Cui <dexuan@FreeBSD.org>2018-07-17 21:05:08 +0000
committerDexuan Cui <dexuan@FreeBSD.org>2018-07-17 21:05:08 +0000
commitd76fb49fd89f7b783798a2a2b76a03c9f988621f (patch)
treed3f4f757640624b5b1deffb467f79a1bcb41ece2 /sys/dev/hyperv
parent11df3a2881788ec9e683fbea679ca6306456ee15 (diff)
Notes
Diffstat (limited to 'sys/dev/hyperv')
-rw-r--r--sys/dev/hyperv/netvsc/if_hn.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c
index 8d8e2f0e81ae..24335638c33d 100644
--- a/sys/dev/hyperv/netvsc/if_hn.c
+++ b/sys/dev/hyperv/netvsc/if_hn.c
@@ -1161,6 +1161,13 @@ hn_ismyvf(const struct hn_softc *sc, const struct ifnet *ifp)
strcmp(ifp->if_dname, "vlan") == 0)
return (false);
+ /*
+ * During detach events ifp->if_addr might be NULL.
+ * Make sure the bcmp() below doesn't panic on that:
+ */
+ if (ifp->if_addr == NULL || hn_ifp->if_addr == NULL)
+ return (false);
+
if (bcmp(IF_LLADDR(ifp), IF_LLADDR(hn_ifp), ETHER_ADDR_LEN) != 0)
return (false);