aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorKris Katterjohn <kjak@users.sourceforge.net>2006-01-13 17:33:06 -0500
committerDavid S. Miller <davem@davemloft.net>2006-01-13 17:33:06 -0500
commit7b11f69fb5c475f521db79f5fa22104e15842671 (patch)
tree631f15d04fb8306b4ce7031f7a75ed44401e68c3 /net/core
parent46b86a2da0fd14bd49765330df63a62279833acb (diff)
[NET]: Clean up comments for sk_chk_filter()
This removes redundant comments, and moves one comment to a better location. Signed-off-by: Kris Katterjohn <kjak@users.sourceforge.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/filter.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/net/core/filter.c b/net/core/filter.c
index 9eb9d0017a01..a52665f75224 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -287,7 +287,9 @@ load_b:
287 * no references or jumps that are out of range, no illegal 287 * no references or jumps that are out of range, no illegal
288 * instructions, and must end with a RET instruction. 288 * instructions, and must end with a RET instruction.
289 * 289 *
290 * Returns 0 if the rule set is legal or a negative errno code if not. 290 * All jumps are forward as they are not signed.
291 *
292 * Returns 0 if the rule set is legal or -EINVAL if not.
291 */ 293 */
292int sk_chk_filter(struct sock_filter *filter, int flen) 294int sk_chk_filter(struct sock_filter *filter, int flen)
293{ 295{
@@ -299,7 +301,6 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
299 301
300 /* check the filter code now */ 302 /* check the filter code now */
301 for (pc = 0; pc < flen; pc++) { 303 for (pc = 0; pc < flen; pc++) {
302 /* all jumps are forward as they are not signed */
303 ftest = &filter[pc]; 304 ftest = &filter[pc];
304 305
305 /* Only allow valid instructions */ 306 /* Only allow valid instructions */
@@ -383,11 +384,6 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
383 } 384 }
384 } 385 }
385 386
386 /*
387 * The program must end with a return. We don't care where they
388 * jumped within the script (its always forwards) but in the end
389 * they _will_ hit this.
390 */
391 return (BPF_CLASS(filter[flen - 1].code) == BPF_RET) ? 0 : -EINVAL; 387 return (BPF_CLASS(filter[flen - 1].code) == BPF_RET) ? 0 : -EINVAL;
392} 388}
393 389