DragonFlyBSD Kernel Audit
DF-2931 / fix.diff
← back to finding ↓ download raw
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -3030,8 +3030,7 @@ if_getanyethermac(uint16_t *node, int minlen)
 		sdl = IF_LLSOCKADDR(ifp);
 		if (sdl->sdl_alen < minlen)
 			continue;
-		bcopy(((struct arpcom *)ifp->if_softc)->ac_enaddr, node,
-		      minlen);
+		bcopy(LLADDR(sdl), node, minlen);
 		ifnet_unlock();
 		return(0);
 	}