sk_filter_trim_cap(9)

sk_filter_trim_cap9

Run a packet through a socket filter

Usage

int sk_filter_trim_cap(struct sock * sk, struct sk_buff * skb, unsigned int cap);

Arguments

sk

sock associated with sk_buff

skb

buffer to filter

cap

limit on how short the eBPF program may trim the packet

Overview

Run the eBPF program and then cut skb->data to correct size returned by the program. If pkt_len is 0 we toss packet. If skb->len is smaller than pkt_len we keep whole skb->data. This is the socket level wrapper to BPF_PROG_RUN. It returns 0 if the packet should be accepted or -EPERM if the packet should be tossed.

Releases

2 releases since Debian 8 (Jessie); the text changed 1 time.

  1. 8
  2. 9

From linux-manual-4.9 4.9.228-1 in Debian 9 (Stretch). Parsed by carta from the page's man source.