]> git.hungrycats.org Git - linux/commitdiff
[PATCH] remove __sk_filter.
authorChris Wright <chris@wirex.com>
Mon, 14 Apr 2003 00:50:21 +0000 (17:50 -0700)
committerDavid S. Miller <davem@nuts.ninka.net>
Mon, 14 Apr 2003 00:50:21 +0000 (17:50 -0700)
include/net/sock.h

index 6235779cc456c7ba0e0a153b13710e4650fdee72..01367c578bad3afa8b8a799e9639cf0adbc17291 100644 (file)
@@ -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.
  *