Off-by-one bug in country ie construction, which will make HOSTAP send out

malformatted beacons.

Reviewed by: sam
Approved by: re (bmah), sam (mentor)
This commit is contained in:
Sepherosa Ziehau 2007-08-26 11:34:51 +00:00
parent 98b335504d
commit f05ba5eeed

View File

@ -182,8 +182,10 @@ ieee80211_add_countryie(uint8_t *frm, struct ieee80211com *ic,
}
}
ie->len = frm - ie->cc;
if (ie->len & 1) /* pad to multiple of 2 */
if (ie->len & 1) { /* Zero pad to multiple of 2 */
ie->len++;
*frm++ = 0;
}
return frm;
#undef CHAN_UNINTERESTING
}