From fa24aedd1f1fdbc6cc224ef54e73d5d67d6c3b02 Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Wed, 12 Jan 2022 15:56:56 -0600 Subject: [PATCH] netlink-request: don't include Done and Ack messages in response --- netlink-request/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlink-request/src/lib.rs b/netlink-request/src/lib.rs index 61af252..152a152 100644 --- a/netlink-request/src/lib.rs +++ b/netlink-request/src/lib.rs @@ -121,13 +121,13 @@ mod linux { let bytes = &buf[offset..]; let response = NetlinkMessage::::deserialize(bytes) .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?; - responses.push(response.clone()); match response.payload { // We've parsed all parts of the response and can leave the loop. NetlinkPayload::Ack(_) | NetlinkPayload::Done => return Ok(responses), NetlinkPayload::Error(e) => return Err(e.into()), _ => {}, } + responses.push(response.clone()); offset += response.header.length as usize; if offset == n_received || response.header.length == 0 { // We've fully parsed the datagram, but there may be further datagrams