Merge tag 'drm-intel-fixes-2013-11-20' of git://people.freedesktop.org/~danvet/drm...
[deliverable/linux.git] / net / netfilter / nft_immediate.c
index 78334bf370073b30f2163c19987cb006e287022b..f169501f1ad4389970613d1e44fb2b60759406cb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008 Patrick McHardy <kaber@trash.net>
+ * Copyright (c) 2008-2009 Patrick McHardy <kaber@trash.net>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -90,35 +90,43 @@ nla_put_failure:
        return -1;
 }
 
-static const struct nft_data *nft_immediate_get_verdict(const struct nft_expr *expr)
+static int nft_immediate_validate(const struct nft_ctx *ctx,
+                                 const struct nft_expr *expr,
+                                 const struct nft_data **data)
 {
        const struct nft_immediate_expr *priv = nft_expr_priv(expr);
 
        if (priv->dreg == NFT_REG_VERDICT)
-               return &priv->data;
-       else
-               return NULL;
+               *data = &priv->data;
+
+       return 0;
 }
 
-static struct nft_expr_ops nft_imm_ops __read_mostly = {
-       .name           = "immediate",
+static struct nft_expr_type nft_imm_type;
+static const struct nft_expr_ops nft_imm_ops = {
+       .type           = &nft_imm_type,
        .size           = NFT_EXPR_SIZE(sizeof(struct nft_immediate_expr)),
-       .owner          = THIS_MODULE,
        .eval           = nft_immediate_eval,
        .init           = nft_immediate_init,
        .destroy        = nft_immediate_destroy,
        .dump           = nft_immediate_dump,
-       .get_verdict    = nft_immediate_get_verdict,
+       .validate       = nft_immediate_validate,
+};
+
+static struct nft_expr_type nft_imm_type __read_mostly = {
+       .name           = "immediate",
+       .ops            = &nft_imm_ops,
        .policy         = nft_immediate_policy,
        .maxattr        = NFTA_IMMEDIATE_MAX,
+       .owner          = THIS_MODULE,
 };
 
 int __init nft_immediate_module_init(void)
 {
-       return nft_register_expr(&nft_imm_ops);
+       return nft_register_expr(&nft_imm_type);
 }
 
 void nft_immediate_module_exit(void)
 {
-       nft_unregister_expr(&nft_imm_ops);
+       nft_unregister_expr(&nft_imm_type);
 }
This page took 0.026763 seconds and 5 git commands to generate.