Skip to content

Commit

Permalink
Merge branch 'libbpf:master' into origin/story/vendorize_dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mmullin-halcyon authored Jul 29, 2023
2 parents e8a7ccc + e370760 commit 73ff47e
Show file tree
Hide file tree
Showing 15 changed files with 131 additions and 124 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
profile: minimal
# Please adjust README and rust-version field in Cargo.toml files when
# bumping version.
toolchain: 1.63.0
toolchain: 1.64.0
components: rustfmt
default: true
- uses: Swatinem/[email protected]
Expand Down
108 changes: 49 additions & 59 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions examples/tc_port_whitelist/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#![allow(clippy::let_unit_value)]

use std::os::unix::io::AsFd as _;

use anyhow::bail;
use anyhow::Context as _;
use anyhow::Result;

use clap::Parser;
Expand Down Expand Up @@ -119,9 +122,11 @@ fn main() -> Result<()> {
for (i, port) in opts.ports.iter().enumerate() {
let key = (i as u32).to_ne_bytes();
let val = port.to_ne_bytes();
if let Err(e) = skel.maps_mut().ports().update(&key, &val, MapFlags::ANY) {
bail!("Example limited to 10 ports: {e}");
}
let () = skel
.maps_mut()
.ports()
.update(&key, &val, MapFlags::ANY)
.context("Example limited to 10 ports")?;
}
ingress.create()?;

Expand Down
6 changes: 6 additions & 0 deletions libbpf-cargo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Unreleased
----------
- Improved error reporting in build script usage
- Bumped minimum Rust version to `1.64`


0.21.1
------
- Adjusted named padding members in generated types to have `pub` visibility
Expand Down
2 changes: 1 addition & 1 deletion libbpf-cargo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ readme = "README.md"
version = "0.21.1"
authors = ["Daniel Xu <[email protected]>", "Daniel Müller <[email protected]>"]
edition = "2021"
rust-version = "1.63"
rust-version = "1.64"
license = "LGPL-2.1-only OR BSD-2-Clause"
keywords = ["bpf", "ebpf", "libbpf"]

Expand Down
2 changes: 1 addition & 1 deletion libbpf-cargo/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![CI](https://github.com/libbpf/libbpf-rs/workflows/Rust/badge.svg?branch=master)
[![rustc](https://img.shields.io/badge/rustc-1.63+-blue.svg)](https://blog.rust-lang.org/2022/08/11/Rust-1.63.0.html)
[![rustc](https://img.shields.io/badge/rustc-1.64+-blue.svg)](https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html)

# libbpf-cargo

Expand Down
2 changes: 1 addition & 1 deletion libbpf-cargo/src/gen/btf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ impl<'s> GenBtf<'s> {
}
Err(e) => {
if gen_impl_default || !t.is_struct {
bail!("Could not construct a necessary Default Impl: {}", e);
return Err(e.context("Could not construct a necessary Default Impl"));
}
}
};
Expand Down
Loading

0 comments on commit 73ff47e

Please sign in to comment.