compat_xtables: move to 2.6.35 API for matches

This commit is contained in:
Jan Engelhardt
2010-03-27 23:22:58 +01:00
parent 02d8bdc3d9
commit beb3358297
9 changed files with 62 additions and 40 deletions

View File

@@ -144,28 +144,28 @@ q2_get_counter(const struct xt_quota_mtinfo2 *q)
return NULL;
}
static bool quota_mt2_check(const struct xt_mtchk_param *par)
static int quota_mt2_check(const struct xt_mtchk_param *par)
{
struct xt_quota_mtinfo2 *q = par->matchinfo;
if (q->flags & ~XT_QUOTA_MASK)
return false;
return -EINVAL;
q->name[sizeof(q->name)-1] = '\0';
if (*q->name == '.' || strchr(q->name, '/') != NULL) {
printk(KERN_ERR "xt_quota<%u>: illegal name\n",
par->match->revision);
return false;
return -EINVAL;
}
q->master = q2_get_counter(q);
if (q->master == NULL) {
printk(KERN_ERR "xt_quota<%u>: memory alloc failure\n",
par->match->revision);
return false;
return -ENOMEM;
}
return true;
return 0;
}
static void quota_mt2_destroy(const struct xt_mtdtor_param *par)