From 6605539c3b088541b289a46e414b42f0c7a73153 Mon Sep 17 00:00:00 2001 From: patrick Date: Wed, 25 Jul 2018 20:37:11 +0000 Subject: [PATCH] On authentication we don't need to create the node before calling the network stack since the stack will create the node for us if we pass the ibss stack. On assocation request the node already has to exist, so we error out if we don't have a record of the node. Fixes hostap on 5 GHz channels, since now the node's channel is recorded correctly. --- sys/dev/ic/bwfm.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/sys/dev/ic/bwfm.c b/sys/dev/ic/bwfm.c index 1c7f2820241..7d03c4cc674 100644 --- a/sys/dev/ic/bwfm.c +++ b/sys/dev/ic/bwfm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bwfm.c,v 1.53 2018/07/17 19:44:38 patrick Exp $ */ +/* $OpenBSD: bwfm.c,v 1.54 2018/07/25 20:37:11 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2016,2017 Patrick Wildt @@ -1925,7 +1925,6 @@ bwfm_rx_auth_ind(struct bwfm_softc *sc, struct bwfm_event *e, size_t len) struct ifnet *ifp = &ic->ic_if; struct ieee80211_rxinfo rxi; struct ieee80211_frame *wh; - struct ieee80211_node *ni; struct mbuf *m; uint32_t pktlen, ieslen; @@ -1952,18 +1951,10 @@ bwfm_rx_auth_ind(struct bwfm_softc *sc, struct bwfm_event *e, size_t len) /* Finalize mbuf. */ m->m_pkthdr.len = m->m_len = pktlen; - ni = ieee80211_find_node(ic, wh->i_addr2); - if (ni == NULL) - ni = ieee80211_alloc_node(ic, wh->i_addr2); - if (ni == NULL) { - m_free(m); - return; - } - ni->ni_chan = &ic->ic_channels[0]; rxi.rxi_flags = 0; rxi.rxi_rssi = 0; rxi.rxi_tstamp = 0; - ieee80211_input(ifp, m, ni, &rxi); + ieee80211_input(ifp, m, ic->ic_bss, &rxi); } void @@ -2012,13 +2003,10 @@ bwfm_rx_assoc_ind(struct bwfm_softc *sc, struct bwfm_event *e, size_t len, /* Finalize mbuf. */ m->m_pkthdr.len = m->m_len = pktlen; ni = ieee80211_find_node(ic, wh->i_addr2); - if (ni == NULL) - ni = ieee80211_alloc_node(ic, wh->i_addr2); if (ni == NULL) { m_free(m); return; } - ni->ni_chan = &ic->ic_channels[0]; rxi.rxi_flags = 0; rxi.rxi_rssi = 0; rxi.rxi_tstamp = 0; -- 2.20.1