From aa92ec96078d09f9b3639109d7a24797ebb239ff Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sun, 24 Apr 2022 21:34:47 +0200 Subject: nft: pass struct nft_xt_ctx to parse_meta() In preparation for native mark match support. Signed-off-by: Pablo Neira Ayuso --- iptables/nft-arp.c | 2 +- iptables/nft-bridge.c | 2 +- iptables/nft-ipv4.c | 2 +- iptables/nft-ipv6.c | 2 +- iptables/nft-shared.c | 6 +++--- iptables/nft-shared.h | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) (limited to 'iptables') diff --git a/iptables/nft-arp.c b/iptables/nft-arp.c index 028b06a6..89e64134 100644 --- a/iptables/nft-arp.c +++ b/iptables/nft-arp.c @@ -174,7 +174,7 @@ static void nft_arp_parse_meta(struct nft_xt_ctx *ctx, struct nftnl_expr *e, struct arpt_entry *fw = &cs->arp; uint8_t flags = 0; - parse_meta(e, ctx->meta.key, fw->arp.iniface, fw->arp.iniface_mask, + parse_meta(ctx, e, ctx->meta.key, fw->arp.iniface, fw->arp.iniface_mask, fw->arp.outiface, fw->arp.outiface_mask, &flags); diff --git a/iptables/nft-bridge.c b/iptables/nft-bridge.c index d4b66a25..097ef6e1 100644 --- a/iptables/nft-bridge.c +++ b/iptables/nft-bridge.c @@ -171,7 +171,7 @@ static void nft_bridge_parse_meta(struct nft_xt_ctx *ctx, uint8_t invflags = 0; char iifname[IFNAMSIZ] = {}, oifname[IFNAMSIZ] = {}; - parse_meta(e, ctx->meta.key, iifname, NULL, oifname, NULL, &invflags); + parse_meta(ctx, e, ctx->meta.key, iifname, NULL, oifname, NULL, &invflags); switch (ctx->meta.key) { case NFT_META_BRI_IIFNAME: diff --git a/iptables/nft-ipv4.c b/iptables/nft-ipv4.c index af3d0c98..cf03edfa 100644 --- a/iptables/nft-ipv4.c +++ b/iptables/nft-ipv4.c @@ -144,7 +144,7 @@ static void nft_ipv4_parse_meta(struct nft_xt_ctx *ctx, struct nftnl_expr *e, break; } - parse_meta(e, ctx->meta.key, cs->fw.ip.iniface, cs->fw.ip.iniface_mask, + parse_meta(ctx, e, ctx->meta.key, cs->fw.ip.iniface, cs->fw.ip.iniface_mask, cs->fw.ip.outiface, cs->fw.ip.outiface_mask, &cs->fw.ip.invflags); } diff --git a/iptables/nft-ipv6.c b/iptables/nft-ipv6.c index 892a4854..5b767a40 100644 --- a/iptables/nft-ipv6.c +++ b/iptables/nft-ipv6.c @@ -117,7 +117,7 @@ static void nft_ipv6_parse_meta(struct nft_xt_ctx *ctx, struct nftnl_expr *e, break; } - parse_meta(e, ctx->meta.key, cs->fw6.ipv6.iniface, + parse_meta(ctx, e, ctx->meta.key, cs->fw6.ipv6.iniface, cs->fw6.ipv6.iniface_mask, cs->fw6.ipv6.outiface, cs->fw6.ipv6.outiface_mask, &cs->fw6.ipv6.invflags); } diff --git a/iptables/nft-shared.c b/iptables/nft-shared.c index b3993211..5b13b29c 100644 --- a/iptables/nft-shared.c +++ b/iptables/nft-shared.c @@ -261,9 +261,9 @@ static void parse_ifname(const char *name, unsigned int len, char *dst, unsigned memset(mask, 0xff, len - 2); } -int parse_meta(struct nftnl_expr *e, uint8_t key, char *iniface, - unsigned char *iniface_mask, char *outiface, - unsigned char *outiface_mask, uint8_t *invflags) +int parse_meta(struct nft_xt_ctx *ctx, struct nftnl_expr *e, uint8_t key, + char *iniface, unsigned char *iniface_mask, + char *outiface, unsigned char *outiface_mask, uint8_t *invflags) { uint32_t value; const void *ifname; diff --git a/iptables/nft-shared.h b/iptables/nft-shared.h index 7b337943..092958cd 100644 --- a/iptables/nft-shared.h +++ b/iptables/nft-shared.h @@ -156,9 +156,9 @@ bool is_same_interfaces(const char *a_iniface, const char *a_outiface, unsigned const char *b_iniface_mask, unsigned const char *b_outiface_mask); -int parse_meta(struct nftnl_expr *e, uint8_t key, char *iniface, - unsigned char *iniface_mask, char *outiface, - unsigned char *outiface_mask, uint8_t *invflags); +int parse_meta(struct nft_xt_ctx *ctx, struct nftnl_expr *e, uint8_t key, + char *iniface, unsigned char *iniface_mask, char *outiface, + unsigned char *outiface_mask, uint8_t *invflags); void get_cmp_data(struct nftnl_expr *e, void *data, size_t dlen, bool *inv); void nft_rule_to_iptables_command_state(struct nft_handle *h, const struct nftnl_rule *r, -- cgit v1.2.3