---
name: "sk_filter"
section: "9"
platform: "linux"
package: "linux-manual-3.2"
version: "3.2.78-1"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/sk_filter"
---

# sk\_filter(9)

run a packet through a socket filter

## NAME

sk\_filter - run a packet through a socket filter

## SYNOPSIS

**int sk\_filter(struct sock \*** *sk***, struct sk\_buff \*** *skb***);**

## ARGUMENTS

*sk*

sock associated with sk\_buff

*skb*

buffer to filter

## DESCRIPTION

Run the filter code and then cut skb-\>data to correct size returned by sk\_run\_filter. 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 sk\_run\_filter. It returns 0 if the packet should be accepted or -EPERM if the packet should be tossed.

## COPYRIGHT
