diff options
| author | Chris Wright <chris@wirex.com> | 2003-04-13 17:50:21 -0700 |
|---|---|---|
| committer | David S. Miller <davem@nuts.ninka.net> | 2003-04-13 17:50:21 -0700 |
| commit | 6457b195640568e1c1242f04ef5785a256d2cc72 (patch) | |
| tree | 6fa8c3c189126d92f653b0fdedc3173b7d92d782 /include | |
| parent | 74e323ba56fdc47cc966f594f25a46723c6fd2bb (diff) | |
[PATCH] remove __sk_filter.
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/sock.h | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 6235779cc456..01367c578bad 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -453,7 +453,7 @@ extern void sock_def_destruct(struct sock *); extern void sock_init_data(struct socket *sock, struct sock *sk); /** - * __sk_filter - run a packet through a socket filter + * sk_filter - run a packet through a socket filter * @sk: sock associated with &sk_buff * @skb: buffer to filter * @needlock: set to 1 if the sock is not locked by caller. @@ -464,14 +464,16 @@ extern void sock_init_data(struct socket *sock, struct sock *sk); * wrapper to sk_run_filter. It returns 0 if the packet should * be accepted or -EPERM if the packet should be tossed. * - * This function should not be called directly, use sk_filter instead - * to ensure that the LSM security check is also performed. */ -static inline int __sk_filter(struct sock *sk, struct sk_buff *skb, int needlock) +static inline int sk_filter(struct sock *sk, struct sk_buff *skb, int needlock) { - int err = 0; - + int err; + + err = security_sock_rcv_skb(sk, skb); + if (err) + return err; + if (sk->filter) { struct sk_filter *filter; @@ -518,17 +520,6 @@ static inline void sk_filter_charge(struct sock *sk, struct sk_filter *fp) atomic_add(sk_filter_len(fp), &sk->omem_alloc); } -static inline int sk_filter(struct sock *sk, struct sk_buff *skb, int needlock) -{ - int err; - - err = security_sock_rcv_skb(sk, skb); - if (err) - return err; - - return __sk_filter(sk, skb, needlock); -} - /* * Socket reference counting postulates. * |
