Commit 4bad4dc9 authored by Kris Katterjohn's avatar Kris Katterjohn Committed by David S. Miller

[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: default avatarKris Katterjohn <kjak@ispwest.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dbbc0988
...@@ -143,7 +143,7 @@ static inline unsigned int sk_filter_len(struct sk_filter *fp) ...@@ -143,7 +143,7 @@ static inline unsigned int sk_filter_len(struct sk_filter *fp)
struct sk_buff; struct sk_buff;
struct sock; 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_attach_filter(struct sock_fprog *fprog, struct sock *sk);
extern int sk_chk_filter(struct sock_filter *filter, int flen); extern int sk_chk_filter(struct sock_filter *filter, int flen);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -856,8 +856,8 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb, int needlock) ...@@ -856,8 +856,8 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb, int needlock)
filter = sk->sk_filter; filter = sk->sk_filter;
if (filter) { if (filter) {
int pkt_len = sk_run_filter(skb, filter->insns, unsigned int pkt_len = sk_run_filter(skb, filter->insns,
filter->len); filter->len);
if (!pkt_len) if (!pkt_len)
err = -EPERM; err = -EPERM;
else else
......
...@@ -75,7 +75,7 @@ static inline void *load_pointer(struct sk_buff *skb, int k, ...@@ -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. * 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 */ struct sock_filter *fentry; /* We walk down these */
void *ptr; void *ptr;
...@@ -241,9 +241,9 @@ load_b: ...@@ -241,9 +241,9 @@ load_b:
A = X; A = X;
continue; continue;
case BPF_RET|BPF_K: case BPF_RET|BPF_K:
return ((unsigned int)fentry->k); return fentry->k;
case BPF_RET|BPF_A: case BPF_RET|BPF_A:
return ((unsigned int)A); return A;
case BPF_ST: case BPF_ST:
mem[fentry->k] = A; mem[fentry->k] = A;
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment