aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKris Katterjohn <kjak@ispwest.com>2006-01-06 16:08:20 -0500
committerDavid S. Miller <davem@davemloft.net>2006-01-06 16:08:20 -0500
commit4bad4dc919573dbe9a5b41dd9edff279e99822d7 (patch)
tree530b791512cfd2f310c5806d109242bccf090fd7
parentdbbc0988288d9643044e8bd8c7e7de70016ecd23 (diff)
[NET]: Change sk_run_filter()'s return type in net/core/filter.c
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>
-rw-r--r--include/linux/filter.h2
-rw-r--r--include/net/sock.h4
-rw-r--r--net/core/filter.c6
3 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 3ba843c4638..c6cb8f09508 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -143,7 +143,7 @@ static inline unsigned int sk_filter_len(struct sk_filter *fp)
143struct sk_buff; 143struct sk_buff;
144struct sock; 144struct sock;
145 145
146extern int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen); 146extern unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen);
147extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); 147extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
148extern int sk_chk_filter(struct sock_filter *filter, int flen); 148extern int sk_chk_filter(struct sock_filter *filter, int flen);
149#endif /* __KERNEL__ */ 149#endif /* __KERNEL__ */
diff --git a/include/net/sock.h b/include/net/sock.h
index 6961700ff3a..1806e5b6141 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -856,8 +856,8 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb, int needlock)
856 856
857 filter = sk->sk_filter; 857 filter = sk->sk_filter;
858 if (filter) { 858 if (filter) {
859 int pkt_len = sk_run_filter(skb, filter->insns, 859 unsigned int pkt_len = sk_run_filter(skb, filter->insns,
860 filter->len); 860 filter->len);
861 if (!pkt_len) 861 if (!pkt_len)
862 err = -EPERM; 862 err = -EPERM;
863 else 863 else
diff --git a/net/core/filter.c b/net/core/filter.c
index 8964d344558..9eb9d0017a0 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -75,7 +75,7 @@ static inline void *load_pointer(struct sk_buff *skb, int k,
75 * len is the number of filter blocks in the array. 75 * len is the number of filter blocks in the array.
76 */ 76 */
77 77
78int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen) 78unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen)
79{ 79{
80 struct sock_filter *fentry; /* We walk down these */ 80 struct sock_filter *fentry; /* We walk down these */
81 void *ptr; 81 void *ptr;
@@ -241,9 +241,9 @@ load_b:
241 A = X; 241 A = X;
242 continue; 242 continue;
243 case BPF_RET|BPF_K: 243 case BPF_RET|BPF_K:
244 return ((unsigned int)fentry->k); 244 return fentry->k;
245 case BPF_RET|BPF_A: 245 case BPF_RET|BPF_A:
246 return ((unsigned int)A); 246 return A;
247 case BPF_ST: 247 case BPF_ST:
248 mem[fentry->k] = A; 248 mem[fentry->k] = A;
249 continue; 249 continue;