-/* $OpenBSD: ieee80211_output.c,v 1.64 2008/08/02 08:20:16 damien Exp $ */
+/* $OpenBSD: ieee80211_output.c,v 1.65 2008/08/02 08:33:21 damien Exp $ */
/* $NetBSD: ieee80211_output.c,v 1.13 2004/05/31 11:02:55 dyoung Exp $ */
/*-
ieee80211_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
struct rtentry *rt)
{
- u_int dlt = 0;
- int s, error = 0;
struct m_tag *mtag;
+ int s, len, error = 0;
+ u_short mflags;
/* Interface has to be up and running */
if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) !=
/* Try to get the DLT from a mbuf tag */
if ((mtag = m_tag_find(m, PACKET_TAG_DLT, NULL)) != NULL) {
- dlt = *(u_int *)(mtag + 1);
+ u_int dlt = *(u_int *)(mtag + 1);
/* Fallback to ethernet for non-802.11 linktypes */
if (!(dlt == DLT_IEEE802_11 || dlt == DLT_IEEE802_11_RADIO))
* further headers, and start output if interface not
* yet active.
*/
+ mflags = m->m_flags;
+ len = m->m_pkthdr.len;
s = splnet();
IFQ_ENQUEUE(&ifp->if_snd, m, NULL, error);
if (error) {
ifp->if_xname);
return (error);
}
- ifp->if_obytes += m->m_pkthdr.len;
- if (m->m_flags & M_MCAST)
+ ifp->if_obytes += len;
+ if (mflags & M_MCAST)
ifp->if_omcasts++;
if ((ifp->if_flags & IFF_OACTIVE) == 0)
(*ifp->if_start)(ifp);
-/* $OpenBSD: ieee80211_pae_output.c,v 1.4 2008/07/27 14:21:15 damien Exp $ */
+/* $OpenBSD: ieee80211_pae_output.c,v 1.5 2008/08/02 08:33:21 damien Exp $ */
/*-
* Copyright (c) 2007,2008 Damien Bergamini <damien.bergamini@free.fr>
struct ifnet *ifp = &ic->ic_if;
struct ether_header *eh;
struct ieee80211_eapol_key *key;
- u_int16_t len, info;
- int s, error;
+ u_int16_t info;
+ int s, len, error;
M_PREPEND(m, sizeof(struct ether_header), M_DONTWAIT);
if (m == NULL)
if (info & EAPOL_KEY_KEYMIC)
ieee80211_eapol_key_mic(key, ptk->kck);
+ len = m->m_pkthdr.len;
s = splnet();
/* start a 100ms timeout if an answer is expected from supplicant */
if (info & EAPOL_KEY_KEYACK)
timeout_add(&ni->ni_rsn_timeout, hz / 10);
IFQ_ENQUEUE(&ifp->if_snd, m, NULL, error);
if (error == 0) {
- ifp->if_obytes += m->m_pkthdr.len;
+ ifp->if_obytes += len;
if ((ifp->if_flags & IFF_OACTIVE) == 0)
(*ifp->if_start)(ifp);
}