sizeof(struct llc) includes padding on arm; use LLC_SNAPFRAMELEN for now
Submitted by: jhay MFC after: 2 weeks
This commit is contained in:
parent
9d62bc1537
commit
012439b03a
@ -746,7 +746,7 @@ ieee80211_decap(struct ieee80211com *ic, struct mbuf *m, int hdrlen)
|
||||
if (llc->llc_dsap == LLC_SNAP_LSAP && llc->llc_ssap == LLC_SNAP_LSAP &&
|
||||
llc->llc_control == LLC_UI && llc->llc_snap.org_code[0] == 0 &&
|
||||
llc->llc_snap.org_code[1] == 0 && llc->llc_snap.org_code[2] == 0) {
|
||||
m_adj(m, hdrlen + sizeof(struct llc) - sizeof(*eh));
|
||||
m_adj(m, hdrlen + LLC_SNAPFRAMELEN - sizeof(*eh));
|
||||
llc = NULL;
|
||||
} else {
|
||||
m_adj(m, hdrlen - sizeof(*eh));
|
||||
|
@ -500,7 +500,7 @@ static struct mbuf *
|
||||
ieee80211_mbuf_adjust(struct ieee80211com *ic, int hdrsize,
|
||||
struct ieee80211_key *key, struct mbuf *m)
|
||||
{
|
||||
#define TO_BE_RECLAIMED (sizeof(struct ether_header) - sizeof(struct llc))
|
||||
#define TO_BE_RECLAIMED (sizeof(struct ether_header) - LLC_SNAPFRAMELEN)
|
||||
int needed_space = hdrsize;
|
||||
|
||||
if (key != NULL) {
|
||||
@ -527,7 +527,7 @@ ieee80211_mbuf_adjust(struct ieee80211com *ic, int hdrsize,
|
||||
* We know we are called just before stripping an Ethernet
|
||||
* header and prepending an LLC header. This means we know
|
||||
* there will be
|
||||
* sizeof(struct ether_header) - sizeof(struct llc)
|
||||
* sizeof(struct ether_header) - LLC_SNAPFRAMELEN
|
||||
* bytes recovered to which we need additional space for the
|
||||
* 802.11 header and any crypto header.
|
||||
*/
|
||||
@ -675,7 +675,7 @@ ieee80211_encap(struct ieee80211com *ic, struct mbuf *m,
|
||||
}
|
||||
|
||||
/* NB: this could be optimized because of ieee80211_mbuf_adjust */
|
||||
m_adj(m, sizeof(struct ether_header) - sizeof(struct llc));
|
||||
m_adj(m, sizeof(struct ether_header) - LLC_SNAPFRAMELEN);
|
||||
llc = mtod(m, struct llc *);
|
||||
llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP;
|
||||
llc->llc_control = LLC_UI;
|
||||
|
Loading…
x
Reference in New Issue
Block a user