diff --git a/src/route/get.rs b/src/route/get.rs index 618b234..9fb481e 100644 --- a/src/route/get.rs +++ b/src/route/get.rs @@ -16,6 +16,7 @@ use crate::{try_rtnl, Error, Handle}; pub struct RouteGetRequest { handle: Handle, message: RouteMessage, + dump: bool, } /// Internet Protocol (IP) version. @@ -38,7 +39,11 @@ impl IpVersion { impl RouteGetRequest { pub(crate) fn new(handle: Handle, message: RouteMessage) -> Self { - RouteGetRequest { handle, message } + RouteGetRequest { + handle, + message, + dump: true, + } } pub fn message_mut(&mut self) -> &mut RouteMessage { @@ -49,11 +54,15 @@ impl RouteGetRequest { let RouteGetRequest { mut handle, message, + dump, } = self; let mut req = NetlinkMessage::from(RouteNetlinkMessage::GetRoute(message)); - req.header.flags = NLM_F_REQUEST | NLM_F_DUMP; + req.header.flags = NLM_F_REQUEST; + if dump { + req.header.flags |= NLM_F_DUMP; + } match handle.request(req) { Ok(response) => Either::Left(response.map(move |msg| {