Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18748
b: refs/heads/master
c: e35bedf
h: refs/heads/master
v: v3
  • Loading branch information
Kris Katterjohn authored and David S. Miller committed Jan 17, 2006
1 parent 8d1c276 commit 31f0df1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dd914b4082cfbe28849898a0a98757827829c813
refs/heads/master: e35bedf369b17120dbd7d554bee45407a3825267
13 changes: 6 additions & 7 deletions trunk/net/core/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ static inline void *load_pointer(struct sk_buff *skb, int k,
* filtering, filter is the array of filter instructions, and
* len is the number of filter blocks in the array.
*/

unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen)
{
struct sock_filter *fentry; /* We walk down these */
Expand Down Expand Up @@ -175,7 +174,7 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int
continue;
case BPF_LD|BPF_W|BPF_ABS:
k = fentry->k;
load_w:
load_w:
ptr = load_pointer(skb, k, 4, &tmp);
if (ptr != NULL) {
A = ntohl(*(u32 *)ptr);
Expand All @@ -184,7 +183,7 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int
break;
case BPF_LD|BPF_H|BPF_ABS:
k = fentry->k;
load_h:
load_h:
ptr = load_pointer(skb, k, 2, &tmp);
if (ptr != NULL) {
A = ntohs(*(u16 *)ptr);
Expand Down Expand Up @@ -374,7 +373,7 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
case BPF_JMP|BPF_JSET|BPF_K:
case BPF_JMP|BPF_JSET|BPF_X:
/* for conditionals both must be safe */
if (pc + ftest->jt + 1 >= flen ||
if (pc + ftest->jt + 1 >= flen ||
pc + ftest->jf + 1 >= flen)
return -EINVAL;
break;
Expand All @@ -384,7 +383,7 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
}
}

return (BPF_CLASS(filter[flen - 1].code) == BPF_RET) ? 0 : -EINVAL;
return (BPF_CLASS(filter[flen - 1].code) == BPF_RET) ? 0 : -EINVAL;
}

/**
Expand All @@ -404,8 +403,8 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
int err;

/* Make sure new filter is there and in the right amounts. */
if (fprog->filter == NULL)
return -EINVAL;
if (fprog->filter == NULL)
return -EINVAL;

fp = sock_kmalloc(sk, fsize+sizeof(*fp), GFP_KERNEL);
if (!fp)
Expand Down

0 comments on commit 31f0df1

Please sign in to comment.