From 152ae5028f808bbea24554e8c286151c1d32f445 Mon Sep 17 00:00:00 2001 From: Kris Katterjohn Date: Fri, 13 Jan 2006 14:33:06 -0800 Subject: [PATCH] --- yaml --- r: 18295 b: refs/heads/master c: 7b11f69fb5c475f521db79f5fa22104e15842671 h: refs/heads/master i: 18293: 3bc1221de87539fee6129435dba9f46af9c023c2 18291: f6fad8bacf1750615bc3ea2cac092571906b1679 18287: d463094945245223b695c6ed0a97b66de62aaac9 v: v3 --- [refs] | 2 +- trunk/net/core/filter.c | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 2ba3cab07b15..6e4fae92f3cc 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 46b86a2da0fd14bd49765330df63a62279833acb +refs/heads/master: 7b11f69fb5c475f521db79f5fa22104e15842671 diff --git a/trunk/net/core/filter.c b/trunk/net/core/filter.c index 9eb9d0017a01..a52665f75224 100644 --- a/trunk/net/core/filter.c +++ b/trunk/net/core/filter.c @@ -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) { @@ -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 */ @@ -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; }