Skip to content

Commit 9a5e061

Browse files
d-e-s-odanielocfb
authored andcommitted
Add CHANGELOG entry for #890
Add a CHANGELOG entry for pull request #890, which adjust the ProgramInput's context_in field to a mutable reference. Signed-off-by: Daniel Müller <[email protected]>
1 parent 64f558d commit 9a5e061

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

libbpf-rs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Unreleased
2020
- Added `Object::name` method
2121
- Added `Copy` and `Clone` impls for types inside `btf::types` module
2222
- Adjusted `OpenMap::set_inner_map_fd` to return `Result`
23+
- Adjusted `ProgramInput::context_in` field to be a mutable reference
2324
- Made inner `query::Tag` contents publicly accessible
2425
- Removed `Display` implementation of various `enum` types
2526

libbpf-rs/src/program.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ impl From<TracepointOpts> for libbpf_sys::bpf_tracepoint_opts {
104104
}
105105
}
106106

107+
107108
/// An immutable parsed but not yet loaded BPF program.
108109
pub type OpenProgram<'obj> = OpenProgramImpl<'obj>;
109110
/// A mutable parsed but not yet loaded BPF program.
@@ -505,6 +506,8 @@ impl From<u32> for ProgramAttachType {
505506
#[derive(Debug, Default)]
506507
pub struct Input<'dat> {
507508
/// The input context to provide.
509+
///
510+
/// The input is mutable because the kernel may modify it.
508511
pub context_in: Option<&'dat mut [u8]>,
509512
/// The output context buffer provided to the program.
510513
pub context_out: Option<&'dat mut [u8]>,
@@ -543,6 +546,7 @@ pub type Program<'obj> = ProgramImpl<'obj>;
543546
/// A mutable loaded BPF program.
544547
pub type ProgramMut<'obj> = ProgramImpl<'obj, Mut>;
545548

549+
546550
/// Represents a loaded [`Program`].
547551
///
548552
/// This struct is not safe to clone because the underlying libbpf resource cannot currently

libbpf-rs/tests/test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ use crate::common::get_test_object;
5656
use crate::common::get_test_object_path;
5757
use crate::common::open_test_object;
5858

59+
5960
/// A helper function for instantiating a `RingBuffer` with a callback meant to
6061
/// be invoked when `action` is executed and that is intended to trigger a write
6162
/// to said `RingBuffer` from kernel space, which then reads a single `i32` from

0 commit comments

Comments
 (0)