bpf: sk_skb: add ::cb() and ::cb_mut() to work with skb->cb

pull/27/head
Alessandro Decina 3 years ago
parent 9c8e78b7d4
commit ef39e0ebd2

@ -30,6 +30,16 @@ impl SkSkbContext {
unsafe { *self.skb }.mark = mark;
}
#[inline]
pub fn cb(&self) -> &[u32] {
unsafe { &(*self.skb).cb }
}
#[inline]
pub fn cb_mut(&self) -> &mut [u32] {
unsafe { &mut (*self.skb).cb }
}
#[inline]
pub fn load<T>(&self, offset: usize) -> Result<T, c_long> {
unsafe {

Loading…
Cancel
Save