Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90598
b: refs/heads/master
c: b715631
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Apr 10, 2008
1 parent 2158d2f commit 89e5685
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 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: d9c58f30b08bfe1e689537af5bc855a76d0fae25
refs/heads/master: b715631fad3ed320b85d386a84a6fb0b3f86b0b9
31 changes: 15 additions & 16 deletions trunk/include/linux/filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,6 @@ struct sock_fprog /* Required for SO_ATTACH_FILTER. */
struct sock_filter __user *filter;
};

#ifdef __KERNEL__
struct sk_filter
{
atomic_t refcnt;
unsigned int len; /* Number of filter blocks */
struct rcu_head rcu;
struct sock_filter insns[0];
};

static inline unsigned int sk_filter_len(struct sk_filter *fp)
{
return fp->len*sizeof(struct sock_filter) + sizeof(*fp);
}
#endif

/*
* Instruction classes
*/
Expand Down Expand Up @@ -141,10 +126,24 @@ static inline unsigned int sk_filter_len(struct sk_filter *fp)
#define SKF_LL_OFF (-0x200000)

#ifdef __KERNEL__
struct sk_filter
{
atomic_t refcnt;
unsigned int len; /* Number of filter blocks */
struct rcu_head rcu;
struct sock_filter insns[0];
};

static inline unsigned int sk_filter_len(const struct sk_filter *fp)
{
return fp->len * sizeof(struct sock_filter) + sizeof(*fp);
}

struct sk_buff;
struct sock;

extern unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen);
extern unsigned int sk_run_filter(struct sk_buff *skb,
struct sock_filter *filter, int flen);
extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
extern int sk_detach_filter(struct sock *sk);
extern int sk_chk_filter(struct sock_filter *filter, int flen);
Expand Down
5 changes: 2 additions & 3 deletions trunk/net/core/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int

return 0;
}
EXPORT_SYMBOL(sk_run_filter);

/**
* sk_chk_filter - verify socket filter code
Expand Down Expand Up @@ -385,6 +386,7 @@ int sk_chk_filter(struct sock_filter *filter, int flen)

return (BPF_CLASS(filter[flen - 1].code) == BPF_RET) ? 0 : -EINVAL;
}
EXPORT_SYMBOL(sk_chk_filter);

/**
* sk_filter_rcu_release: Release a socket filter by rcu_head
Expand Down Expand Up @@ -467,6 +469,3 @@ int sk_detach_filter(struct sock *sk)
rcu_read_unlock_bh();
return ret;
}

EXPORT_SYMBOL(sk_chk_filter);
EXPORT_SYMBOL(sk_run_filter);

0 comments on commit 89e5685

Please sign in to comment.