Pass the correct buffer when creating TcpSocket

This commit is contained in:
Ulf Lilleengen 2023-01-31 19:36:37 +01:00
parent c21cc21c62
commit 768fe699cf
Failed to extract signature

View File

@ -389,7 +389,7 @@ pub mod client {
fn new<D: Driver>(stack: &'d Stack<D>, state: &'d TcpClientState<N, TX_SZ, RX_SZ>) -> Result<Self, Error> { fn new<D: Driver>(stack: &'d Stack<D>, state: &'d TcpClientState<N, TX_SZ, RX_SZ>) -> Result<Self, Error> {
let mut bufs = state.pool.alloc().ok_or(Error::ConnectionReset)?; let mut bufs = state.pool.alloc().ok_or(Error::ConnectionReset)?;
Ok(Self { Ok(Self {
socket: unsafe { TcpSocket::new(stack, &mut bufs.as_mut().0, &mut bufs.as_mut().1) }, socket: unsafe { TcpSocket::new(stack, &mut bufs.as_mut().1, &mut bufs.as_mut().0) },
state, state,
bufs, bufs,
}) })