-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump netlink-packet-utils and netlink-packet-core crates #156
base: main
Are you sure you want to change the base?
Conversation
Bump netlink-packet-utils, get rid of anyhow, and adjust the code accordingly. Signed-off-by: Quentin Monnet <[email protected]>
.map(|nla| nla.and_then(|nla| InfoBondPort::parse(&nla))) | ||
.map(|nla| { | ||
nla.and_then(|nla| { | ||
InfoBondPort::parse(&nla) | ||
// Placeholder error, as we need to return a NlaError | ||
.map_err(|_| NlaError::InvalidLength { nla_len: 0 }) | ||
}) | ||
}) | ||
.collect::<Result<Vec<_>, _>>() | ||
.map(InfoPortData::BondPort), | ||
InfoPortKind::Bridge => NlasIterator::new(payload) | ||
.map(|nla| nla.and_then(|nla| InfoBridgePort::parse(&nla))) | ||
.map(|nla| { | ||
nla.and_then(|nla| { | ||
InfoBridgePort::parse(&nla) | ||
// Placeholder error, as we need to return a NlaError | ||
.map_err(|_| NlaError::InvalidLength { nla_len: 0 }) | ||
}) | ||
}) | ||
.collect::<Result<Vec<_>, _>>() | ||
.map(InfoPortData::BridgePort), | ||
InfoPortKind::Vrf => NlasIterator::new(payload) | ||
.map(|nla| nla.and_then(|nla| InfoVrfPort::parse(&nla))) | ||
.map(|nla| { | ||
nla.and_then(|nla| { | ||
InfoVrfPort::parse(&nla) | ||
// Placeholder error, as we need to return a NlaError | ||
.map_err(|_| NlaError::InvalidLength { nla_len: 0 }) | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one of the chunks that I don't believe are the right way to address the changes.
TCA_ACT_KIND => Some( | ||
parse_string(nla.value()) | ||
.context("failed to parse TCA_ACT_KIND"), | ||
), | ||
TCA_ACT_KIND => { | ||
Some(parse_string(nla.value()).map_err(|_| { | ||
// Placeholder error, as we need to return a NlaError | ||
NlaError::InvalidLength { nla_len: 0 } | ||
})) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one, too.
match RouteNetlinkMessage::parse_with_param(&buf, header.message_type) { | ||
Err(e) => Err(e), | ||
Ok(message) => Ok(message), | ||
} | ||
RouteNetlinkMessage::parse_with_param(&buf, header.message_type) | ||
.map_err(|_| NlaError::InvalidLength { nla_len: 0 }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this seems not correct either.
bitflags = "2" | ||
byteorder = "1.3.2" | ||
libc = "0.2.66" | ||
log = { version = "0.4.20", features = ["std"] } | ||
netlink-packet-core = { version = "0.7.0" } | ||
netlink-packet-utils = { version = "0.5.2" } | ||
netlink-packet-core = { git = "https://github.com/rust-netlink/netlink-packet-core.git", rev = "01e8dd1" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is temporary, obviously.
“Bump netlink-packet-utils, get rid of anyhow, and adjust the code accordingly.”
In practice, the PR is not ready yet; but I could do with some feedback.
What's missing:
netlink-packet-core