ieee80211_freebsd.c (c1225b52f6a0f0ff6834dc34d5b6f94020097784) | ieee80211_freebsd.c (34333b16cdbff9a44599686b809052878716f44e) |
---|---|
1/*- 2 * Copyright (c) 2003-2005 Sam Leffler, Errno Consulting 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 156 unchanged lines hidden (view full) --- 165 /* 166 * NB: we know the mbuf routines will align the data area 167 * so we don't need to do anything special. 168 */ 169 /* XXX 4-address frame? */ 170 len = roundup(sizeof(struct ieee80211_frame) + pktlen, 4); 171 KASSERT(len <= MCLBYTES, ("802.11 mgt frame too large: %u", len)); 172 if (len < MINCLSIZE) { | 1/*- 2 * Copyright (c) 2003-2005 Sam Leffler, Errno Consulting 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 156 unchanged lines hidden (view full) --- 165 /* 166 * NB: we know the mbuf routines will align the data area 167 * so we don't need to do anything special. 168 */ 169 /* XXX 4-address frame? */ 170 len = roundup(sizeof(struct ieee80211_frame) + pktlen, 4); 171 KASSERT(len <= MCLBYTES, ("802.11 mgt frame too large: %u", len)); 172 if (len < MINCLSIZE) { |
173 m = m_gethdr(M_NOWAIT, MT_HEADER); | 173 m = m_gethdr(M_NOWAIT, MT_DATA); |
174 /* 175 * Align the data in case additional headers are added. 176 * This should only happen when a WEP header is added 177 * which only happens for shared key authentication mgt 178 * frames which all fit in MHLEN. 179 */ 180 if (m != NULL) 181 MH_ALIGN(m, len); 182 } else | 174 /* 175 * Align the data in case additional headers are added. 176 * This should only happen when a WEP header is added 177 * which only happens for shared key authentication mgt 178 * frames which all fit in MHLEN. 179 */ 180 if (m != NULL) 181 MH_ALIGN(m, len); 182 } else |
183 m = m_getcl(M_NOWAIT, MT_HEADER, M_PKTHDR); | 183 m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); |
184 if (m != NULL) { 185 m->m_data += sizeof(struct ieee80211_frame); 186 *frm = m->m_data; 187 } 188 return m; 189} 190 191#include <sys/libkern.h> --- 158 unchanged lines hidden --- | 184 if (m != NULL) { 185 m->m_data += sizeof(struct ieee80211_frame); 186 *frm = m->m_data; 187 } 188 return m; 189} 190 191#include <sys/libkern.h> --- 158 unchanged lines hidden --- |