View | Details | Raw Unified | Return to bug 179532 | Differences between
and this patch

Collapse All | Expand All

(-)if_run.c (-7 / +19 lines)
Lines 52-57 Link Here
52
#include <net/if_dl.h>
52
#include <net/if_dl.h>
53
#include <net/if_media.h>
53
#include <net/if_media.h>
54
#include <net/if_types.h>
54
#include <net/if_types.h>
55
#include <net/vnet.h>
55
56
56
#include <netinet/in.h>
57
#include <netinet/in.h>
57
#include <netinet/in_systm.h>
58
#include <netinet/in_systm.h>
Lines 606-614 Link Here
606
607
607
	RUN_UNLOCK(sc);
608
	RUN_UNLOCK(sc);
608
609
610
	CURVNET_SET(vnet0);
611
609
	ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211);
612
	ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211);
610
	if (ifp == NULL) {
613
	if (ifp == NULL) {
611
		device_printf(sc->sc_dev, "can not if_alloc()\n");
614
		device_printf(sc->sc_dev, "can not if_alloc()\n");
615
		CURVNET_RESTORE();
612
		goto detach;
616
		goto detach;
613
	}
617
	}
614
	ic = ifp->if_l2com;
618
	ic = ifp->if_l2com;
Lines 702-707 Link Here
702
	if (bootverbose)
706
	if (bootverbose)
703
		ieee80211_announce(ic);
707
		ieee80211_announce(ic);
704
708
709
	CURVNET_RESTORE();
710
705
	return (0);
711
	return (0);
706
712
707
detach:
713
detach:
Lines 739-746 Link Here
739
		usb_callout_drain(&sc->ratectl_ch);
745
		usb_callout_drain(&sc->ratectl_ch);
740
		ieee80211_draintask(ic, &sc->cmdq_task);
746
		ieee80211_draintask(ic, &sc->cmdq_task);
741
		ieee80211_draintask(ic, &sc->ratectl_task);
747
		ieee80211_draintask(ic, &sc->ratectl_task);
748
		CURVNET_SET(ifp->if_vnet);
742
		ieee80211_ifdetach(ic);
749
		ieee80211_ifdetach(ic);
743
		if_free(ifp);
750
		if_free(ifp);
751
		CURVNET_RESTORE();
744
	}
752
	}
745
753
746
	mtx_destroy(&sc->sc_mtx);
754
	mtx_destroy(&sc->sc_mtx);
Lines 2528-2540 Link Here
2528
	m->m_pkthdr.rcvif = ifp;
2536
	m->m_pkthdr.rcvif = ifp;
2529
	m->m_pkthdr.len = m->m_len = len;
2537
	m->m_pkthdr.len = m->m_len = len;
2530
2538
2531
	if (ni != NULL) {
2539
	/*
2532
		(void)ieee80211_input(ni, m, rssi, nf);
2540
	 * DAAN: fill-in tap header BEFORE calling ieee80211_input*() so the
2533
		ieee80211_free_node(ni);
2541
	 * user will see the actual data that belongs to THIS packet..
2534
	} else {
2542
	 */
2535
		(void)ieee80211_input_all(ic, m, rssi, nf);
2536
	}
2537
2538
	if (__predict_false(ieee80211_radiotap_active(ic))) {
2543
	if (__predict_false(ieee80211_radiotap_active(ic))) {
2539
		struct run_rx_radiotap_header *tap = &sc->sc_rxtap;
2544
		struct run_rx_radiotap_header *tap = &sc->sc_rxtap;
2540
2545
Lines 2571-2576 Link Here
2571
			break;
2576
			break;
2572
		}
2577
		}
2573
	}
2578
	}
2579
2580
	if (ni != NULL) {
2581
		(void)ieee80211_input(ni, m, rssi, nf);
2582
		ieee80211_free_node(ni);
2583
	} else {
2584
		(void)ieee80211_input_all(ic, m, rssi, nf);
2585
	}
2574
}
2586
}
2575
2587
2576
static void
2588
static void

Return to bug 179532