wpan: fix datarequest

This commit is contained in:
xoviat 2023-07-16 18:07:05 -05:00
parent 34217ea797
commit fe1e7c4d76
2 changed files with 2 additions and 2 deletions

View File

@ -370,7 +370,7 @@ pub struct DataRequest {
impl DataRequest { impl DataRequest {
pub fn set_buffer<'a>(&'a mut self, buf: &'a [u8]) -> &mut Self { pub fn set_buffer<'a>(&'a mut self, buf: &'a [u8]) -> &mut Self {
self.msdu_ptr = &buf as *const _ as *const u8; self.msdu_ptr = buf as *const _ as *const u8;
self.msdu_length = buf.len() as u8; self.msdu_length = buf.len() as u8;
self self

View File

@ -237,7 +237,7 @@ impl ParseableMacEvent for DataIndication {}
impl DataIndication { impl DataIndication {
pub fn payload<'a>(&'a self) -> &'a [u8] { pub fn payload<'a>(&'a self) -> &'a [u8] {
unsafe { slice::from_raw_parts(self.msdu_ptr as *const _ as *const u8, self.msdu_length as usize) } unsafe { slice::from_raw_parts(self.msdu_ptr, self.msdu_length as usize) }
} }
} }