]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[NET]: Change sk_run_filter()'s return type in net/core/filter.c
authorKris Katterjohn <kjak@ispwest.com>
Fri, 6 Jan 2006 21:08:20 +0000 (13:08 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Jan 2006 21:08:20 +0000 (13:08 -0800)
It should return an unsigned value, and fix sk_filter() as well.

Signed-off-by: Kris Katterjohn <kjak@ispwest.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/filter.h
include/net/sock.h
net/core/filter.c

index 3ba843c46382efdf8daf321e3a1be88ba09a2fec..c6cb8f095088aada43f585eb51fc7c8fc4573cc7 100644 (file)
@@ -143,7 +143,7 @@ static inline unsigned int sk_filter_len(struct sk_filter *fp)
 struct sk_buff;
 struct sock;
 
-extern int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen);
+extern unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen);
 extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
 extern int sk_chk_filter(struct sock_filter *filter, int flen);
 #endif /* __KERNEL__ */
index 6961700ff3a03584309a7c40b4fccd6f83bd8220..1806e5b6141936376352373343c3a37510af6bbf 100644 (file)
@@ -856,8 +856,8 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb, int needlock)
                
                filter = sk->sk_filter;
                if (filter) {
-                       int pkt_len = sk_run_filter(skb, filter->insns,
-                                                   filter->len);
+                       unsigned int pkt_len = sk_run_filter(skb, filter->insns,
+                                                            filter->len);
                        if (!pkt_len)
                                err = -EPERM;
                        else
index 8964d344558889bdf6c62c2d4383a265a38a433c..9eb9d0017a01810e37c42f142bbdadbdb3cfee3e 100644 (file)
@@ -75,7 +75,7 @@ static inline void *load_pointer(struct sk_buff *skb, int k,
  * len is the number of filter blocks in the array.
  */
  
-int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen)
+unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen)
 {
        struct sock_filter *fentry;     /* We walk down these */
        void *ptr;
@@ -241,9 +241,9 @@ load_b:
                        A = X;
                        continue;
                case BPF_RET|BPF_K:
-                       return ((unsigned int)fentry->k);
+                       return fentry->k;
                case BPF_RET|BPF_A:
-                       return ((unsigned int)A);
+                       return A;
                case BPF_ST:
                        mem[fentry->k] = A;
                        continue;