summaryrefslogtreecommitdiffstats
path: root/src/expr/meta.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr/meta.c')
-rw-r--r--src/expr/meta.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/expr/meta.c b/src/expr/meta.c
index ceb7af2..6b19764 100644
--- a/src/expr/meta.c
+++ b/src/expr/meta.c
@@ -35,7 +35,7 @@ static int
nft_rule_expr_meta_set(struct nft_rule_expr *e, uint16_t type,
const void *data, size_t data_len)
{
- struct nft_expr_meta *meta = (struct nft_expr_meta *)e->data;
+ struct nft_expr_meta *meta = nft_expr_data(e);
switch(type) {
case NFT_EXPR_META_KEY:
@@ -54,7 +54,7 @@ static const void *
nft_rule_expr_meta_get(const struct nft_rule_expr *e, uint16_t type,
size_t *data_len)
{
- struct nft_expr_meta *meta = (struct nft_expr_meta *)e->data;
+ struct nft_expr_meta *meta = nft_expr_data(e);
switch(type) {
case NFT_EXPR_META_KEY:
@@ -102,7 +102,7 @@ static int nft_rule_expr_meta_cb(const struct nlattr *attr, void *data)
static void
nft_rule_expr_meta_build(struct nlmsghdr *nlh, struct nft_rule_expr *e)
{
- struct nft_expr_meta *meta = (struct nft_expr_meta *)e->data;
+ struct nft_expr_meta *meta = nft_expr_data(e);
if (e->flags & (1 << NFT_EXPR_META_KEY))
mnl_attr_put_u32(nlh, NFTA_META_KEY, htonl(meta->key));
@@ -113,7 +113,7 @@ nft_rule_expr_meta_build(struct nlmsghdr *nlh, struct nft_rule_expr *e)
static int
nft_rule_expr_meta_parse(struct nft_rule_expr *e, struct nlattr *attr)
{
- struct nft_expr_meta *meta = (struct nft_expr_meta *)e->data;
+ struct nft_expr_meta *meta = nft_expr_data(e);
struct nlattr *tb[NFTA_META_MAX+1] = {};
if (mnl_attr_parse_nested(attr, nft_rule_expr_meta_cb, tb) < 0)
@@ -172,7 +172,7 @@ static inline int str2meta_key(const char *str)
static int nft_rule_expr_meta_xml_parse(struct nft_rule_expr *e, mxml_node_t *tree)
{
#ifdef XML_PARSING
- struct nft_expr_meta *meta = (struct nft_expr_meta *)e->data;
+ struct nft_expr_meta *meta = nft_expr_data(e);
mxml_node_t *node = NULL;
int32_t reg;
int key;
@@ -207,7 +207,7 @@ static int
nft_rule_expr_meta_snprintf(char *buf, size_t len, uint32_t type,
uint32_t flags, struct nft_rule_expr *e)
{
- struct nft_expr_meta *meta = (struct nft_expr_meta *)e->data;
+ struct nft_expr_meta *meta = nft_expr_data(e);
switch(type) {
case NFT_RULE_O_DEFAULT: