mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 13:22:57 +00:00
[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>
This commit is contained in:
parent
46b86a2da0
commit
7b11f69fb5
1 changed files with 3 additions and 7 deletions
|
@ -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
|
* no references or jumps that are out of range, no illegal
|
||||||
* instructions, and must end with a RET instruction.
|
* 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)
|
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 */
|
/* check the filter code now */
|
||||||
for (pc = 0; pc < flen; pc++) {
|
for (pc = 0; pc < flen; pc++) {
|
||||||
/* all jumps are forward as they are not signed */
|
|
||||||
ftest = &filter[pc];
|
ftest = &filter[pc];
|
||||||
|
|
||||||
/* Only allow valid instructions */
|
/* 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;
|
return (BPF_CLASS(filter[flen - 1].code) == BPF_RET) ? 0 : -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue