|
@@ -104,16 +104,16 @@ static int tcindex_classify(struct sk_buff *skb, const struct tcf_proto *tp,
|
|
|
}
|
|
|
|
|
|
|
|
|
-static unsigned long tcindex_get(struct tcf_proto *tp, u32 handle)
|
|
|
+static void *tcindex_get(struct tcf_proto *tp, u32 handle)
|
|
|
{
|
|
|
struct tcindex_data *p = rtnl_dereference(tp->root);
|
|
|
struct tcindex_filter_result *r;
|
|
|
|
|
|
pr_debug("tcindex_get(tp %p,handle 0x%08x)\n", tp, handle);
|
|
|
if (p->perfect && handle >= p->alloc_hash)
|
|
|
- return 0;
|
|
|
+ return NULL;
|
|
|
r = tcindex_lookup(p, handle);
|
|
|
- return r && tcindex_filter_is_set(r) ? (unsigned long) r : 0UL;
|
|
|
+ return r && tcindex_filter_is_set(r) ? r : NULL;
|
|
|
}
|
|
|
|
|
|
static int tcindex_init(struct tcf_proto *tp)
|
|
@@ -150,14 +150,14 @@ static void tcindex_destroy_fexts(struct rcu_head *head)
|
|
|
kfree(f);
|
|
|
}
|
|
|
|
|
|
-static int tcindex_delete(struct tcf_proto *tp, unsigned long arg, bool *last)
|
|
|
+static int tcindex_delete(struct tcf_proto *tp, void *arg, bool *last)
|
|
|
{
|
|
|
struct tcindex_data *p = rtnl_dereference(tp->root);
|
|
|
- struct tcindex_filter_result *r = (struct tcindex_filter_result *) arg;
|
|
|
+ struct tcindex_filter_result *r = arg;
|
|
|
struct tcindex_filter __rcu **walk;
|
|
|
struct tcindex_filter *f = NULL;
|
|
|
|
|
|
- pr_debug("tcindex_delete(tp %p,arg 0x%lx),p %p\n", tp, arg, p);
|
|
|
+ pr_debug("tcindex_delete(tp %p,arg %p),p %p\n", tp, arg, p);
|
|
|
if (p->perfect) {
|
|
|
if (!r->res.class)
|
|
|
return -ENOENT;
|
|
@@ -192,8 +192,7 @@ found:
|
|
|
}
|
|
|
|
|
|
static int tcindex_destroy_element(struct tcf_proto *tp,
|
|
|
- unsigned long arg,
|
|
|
- struct tcf_walker *walker)
|
|
|
+ void *arg, struct tcf_walker *walker)
|
|
|
{
|
|
|
bool last;
|
|
|
|
|
@@ -471,17 +470,17 @@ errout:
|
|
|
static int
|
|
|
tcindex_change(struct net *net, struct sk_buff *in_skb,
|
|
|
struct tcf_proto *tp, unsigned long base, u32 handle,
|
|
|
- struct nlattr **tca, unsigned long *arg, bool ovr)
|
|
|
+ struct nlattr **tca, void **arg, bool ovr)
|
|
|
{
|
|
|
struct nlattr *opt = tca[TCA_OPTIONS];
|
|
|
struct nlattr *tb[TCA_TCINDEX_MAX + 1];
|
|
|
struct tcindex_data *p = rtnl_dereference(tp->root);
|
|
|
- struct tcindex_filter_result *r = (struct tcindex_filter_result *) *arg;
|
|
|
+ struct tcindex_filter_result *r = *arg;
|
|
|
int err;
|
|
|
|
|
|
pr_debug("tcindex_change(tp %p,handle 0x%08x,tca %p,arg %p),opt %p,"
|
|
|
- "p %p,r %p,*arg 0x%lx\n",
|
|
|
- tp, handle, tca, arg, opt, p, r, arg ? *arg : 0L);
|
|
|
+ "p %p,r %p,*arg %p\n",
|
|
|
+ tp, handle, tca, arg, opt, p, r, arg ? *arg : NULL);
|
|
|
|
|
|
if (!opt)
|
|
|
return 0;
|
|
@@ -506,9 +505,7 @@ static void tcindex_walk(struct tcf_proto *tp, struct tcf_walker *walker)
|
|
|
if (!p->perfect[i].res.class)
|
|
|
continue;
|
|
|
if (walker->count >= walker->skip) {
|
|
|
- if (walker->fn(tp,
|
|
|
- (unsigned long) (p->perfect+i), walker)
|
|
|
- < 0) {
|
|
|
+ if (walker->fn(tp, p->perfect + i, walker) < 0) {
|
|
|
walker->stop = 1;
|
|
|
return;
|
|
|
}
|
|
@@ -522,8 +519,7 @@ static void tcindex_walk(struct tcf_proto *tp, struct tcf_walker *walker)
|
|
|
for (f = rtnl_dereference(p->h[i]); f; f = next) {
|
|
|
next = rtnl_dereference(f->next);
|
|
|
if (walker->count >= walker->skip) {
|
|
|
- if (walker->fn(tp, (unsigned long) &f->result,
|
|
|
- walker) < 0) {
|
|
|
+ if (walker->fn(tp, &f->result, walker) < 0) {
|
|
|
walker->stop = 1;
|
|
|
return;
|
|
|
}
|
|
@@ -548,14 +544,14 @@ static void tcindex_destroy(struct tcf_proto *tp)
|
|
|
}
|
|
|
|
|
|
|
|
|
-static int tcindex_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
|
|
|
+static int tcindex_dump(struct net *net, struct tcf_proto *tp, void *fh,
|
|
|
struct sk_buff *skb, struct tcmsg *t)
|
|
|
{
|
|
|
struct tcindex_data *p = rtnl_dereference(tp->root);
|
|
|
- struct tcindex_filter_result *r = (struct tcindex_filter_result *) fh;
|
|
|
+ struct tcindex_filter_result *r = fh;
|
|
|
struct nlattr *nest;
|
|
|
|
|
|
- pr_debug("tcindex_dump(tp %p,fh 0x%lx,skb %p,t %p),p %p,r %p\n",
|
|
|
+ pr_debug("tcindex_dump(tp %p,fh %p,skb %p,t %p),p %p,r %p\n",
|
|
|
tp, fh, skb, t, p, r);
|
|
|
pr_debug("p->perfect %p p->h %p\n", p->perfect, p->h);
|
|
|
|