Thread (26 messages) 26 messages, 4 authors, 2026-03-16

Re: [PATCH 1/4] rust: netlink: add raw netlink abstraction

From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-03-07 15:43:28
Also in: lkml, rust-for-linux

quoted hunk ↗ jump to hunk
diff --git a/rust/kernel/netlink.rs b/rust/kernel/netlink.rs
...
+/// The default netlink message size.
+pub const GENLMSG_DEFAULT_SIZE: usize = bindings::GENLMSG_DEFAULT_SIZE;
+
+/// A wrapper around `struct sk_buff` for generic netlink messages.
+///
+/// # Invariants
+///
+/// The pointer has ownership over a valid `sk_buff`.
+pub struct SkBuff {
+    skb: NonNull<kernel::bindings::sk_buff>,
+}
struct sk_buff is a core data structure which appears all over the
networking stack, but also other places like crypto, scsi, tty, file
systems, etc. Since it is a top level data structure, it seems odd
Rust puts it into netlink.rs.

How do you see the Rust SkBuff evolving to a general purpose data
structure which can be used everywhere?

	  Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help