Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224445
b: refs/heads/master
c: c26aed4
h: refs/heads/master
i:
  224443: d3cf53a
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 19, 2010
1 parent 57fa14c commit a2ed29e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 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: 8c1592d68bc89248bfd0ee287648f41c1370d826
refs/heads/master: c26aed40f4fd18f86bcc6aba557cab700b129b73
4 changes: 3 additions & 1 deletion trunk/net/core/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <asm/uaccess.h>
#include <asm/unaligned.h>
#include <linux/filter.h>
#include <linux/reciprocal_div.h>

enum {
BPF_S_RET_K = 1,
Expand Down Expand Up @@ -205,7 +206,7 @@ unsigned int sk_run_filter(struct sk_buff *skb, const struct sock_filter *fentry
A /= X;
continue;
case BPF_S_ALU_DIV_K:
A /= K;
A = reciprocal_divide(A, K);
continue;
case BPF_S_ALU_AND_X:
A &= X;
Expand Down Expand Up @@ -506,6 +507,7 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
/* check for division by zero */
if (ftest->k == 0)
return -EINVAL;
ftest->k = reciprocal_value(ftest->k);
break;
case BPF_S_LD_MEM:
case BPF_S_LDX_MEM:
Expand Down

0 comments on commit a2ed29e

Please sign in to comment.