.ok_or_else(|| io::Error::from(io::ErrorKind::UnexpectedEof))?;
//eprintln!("data={:?}", DumpHex(&data));
- check
- ::<_,_,_,Slip2Mime>(ic.mtu, &data, &mut packets, |header| {
+ match check1
+ ::<_,Slip2Mime>(ic.mtu, &data, |header| {
let addr = ip_packet_addr::<false>(header)?;
if addr != ic.link.client.0 { throw!(PE::Src(addr)) }
Ok(())
- }, |e| match e {
- PE::Empty => { },
- e@ PE::Src(_) => debug!("{}: tx discarding: {}", &ic, e),
- e => error!("{}: tx discarding: {}", &ic, e),
- });
+ }) {
+ Ok(packet) => packets.push_back(packet),
+ Err(PE::Empty) => { },
+ Err(e@ PE::Src(_)) => debug!("{}: tx discarding: {}", &ic, e),
+ Err(e) => error!("{}: tx discarding: {}", &ic, e),
+ };
},
_ = async { },
if let Some(got) = got {
//eprintln!("got={:?}", DumpHex(&got));
- check
+ checkn
::<_,_,_,SlipNoConv>(ic.mtu, &got, &mut rx_queue, |header| {
let addr = ip_packet_addr::<true>(header)?;
if addr != ic.link.client.0 { throw!(PE::Dst(addr)) }
impl SlipMime for Mime2Slip { const CONV_TO: Option<bool> = Some(false); }
impl SlipMime for SlipNoConv { const CONV_TO: Option<bool> = None; }
-pub fn check<AC, EH, OUT, M: SlipMime>(
+pub fn checkn<AC, EH, OUT, M: SlipMime>(
mtu: u32,
data: &[u8],
out: &mut OUT,