From b0079d05dad9f9824dcdfcfdc56b7b8760888645 Mon Sep 17 00:00:00 2001 From: patrick Date: Mon, 16 Jul 2018 11:52:26 +0000 Subject: [PATCH] Re-set the pointer to the bwfm event after the strict alignment check. --- sys/dev/ic/bwfm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/ic/bwfm.c b/sys/dev/ic/bwfm.c index b7a5f98041a..3196c6a9370 100644 --- a/sys/dev/ic/bwfm.c +++ b/sys/dev/ic/bwfm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bwfm.c,v 1.50 2018/07/06 12:30:36 patrick Exp $ */ +/* $OpenBSD: bwfm.c,v 1.51 2018/07/16 11:52:26 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2016,2017 Patrick Wildt @@ -1859,9 +1859,9 @@ bwfm_rx(struct bwfm_softc *sc, struct mbuf *m) { struct ieee80211com *ic = &sc->sc_ic; struct ifnet *ifp = &ic->ic_if; - struct bwfm_event *e = mtod(m, struct bwfm_event *); struct mbuf_list ml = MBUF_LIST_INITIALIZER(); struct ieee80211_node *ni; + struct bwfm_event *e; #ifdef __STRICT_ALIGNMENT /* Remaining data is an ethernet packet, so align. */ @@ -1877,6 +1877,7 @@ bwfm_rx(struct bwfm_softc *sc, struct mbuf *m) } #endif + e = mtod(m, struct bwfm_event *); if (m->m_len >= sizeof(e->ehdr) && ntohs(e->ehdr.ether_type) == BWFM_ETHERTYPE_LINK_CTL && memcmp(BWFM_BRCM_OUI, e->hdr.oui, sizeof(e->hdr.oui)) == 0 && -- 2.20.1