Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18295
b: refs/heads/master
c: 7b11f69
h: refs/heads/master
i:
  18293: 3bc1221
  18291: f6fad8b
  18287: d463094
v: v3
  • Loading branch information
Kris Katterjohn authored and David S. Miller committed Jan 13, 2006
1 parent 814c7e3 commit 152ae50
Show file tree
Hide file tree
Showing 2 changed files with 4 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: 46b86a2da0fd14bd49765330df63a62279833acb
refs/heads/master: 7b11f69fb5c475f521db79f5fa22104e15842671
10 changes: 3 additions & 7 deletions trunk/net/core/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int
* no references or jumps that are out of range, no illegal
* instructions, and must end with a RET instruction.
*
* Returns 0 if the rule set is legal or a negative errno code if not.
* All jumps are forward as they are not signed.
*
* Returns 0 if the rule set is legal or -EINVAL if not.
*/
int sk_chk_filter(struct sock_filter *filter, int flen)
{
Expand All @@ -299,7 +301,6 @@ int sk_chk_filter(struct sock_filter *filter, int flen)

/* check the filter code now */
for (pc = 0; pc < flen; pc++) {
/* all jumps are forward as they are not signed */
ftest = &filter[pc];

/* Only allow valid instructions */
Expand Down Expand Up @@ -383,11 +384,6 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
}
}

/*
* The program must end with a return. We don't care where they
* jumped within the script (its always forwards) but in the end
* they _will_ hit this.
*/
return (BPF_CLASS(filter[flen - 1].code) == BPF_RET) ? 0 : -EINVAL;
}

Expand Down

0 comments on commit 152ae50

Please sign in to comment.